-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced Snap Middle Manual Tool #1424
Conversation
A nice to have feature. A bit clumsy to use, though. I would prefer it to be integrated into the drawing workflow. Like draw a line from an existing point A to the middle of point B and C. I think this is called a transparent command, a sub command used within a main command. Probably not that easy. Do you think you could tackle this? Or are inclined to at all? A similar and even more valuable feature would be Snap to the imaginary intersection of two not really intersecting lines. Where to place it in the user interface? You have put it at Tools. Maybe the snaps or relative zero bar is a better place. |
I did not have all this in mind. My aim was to simply accomplish the exact feature from the newer version of QCAD as requested by @gerardbm. It seems to do the exact same thing as mentioned in his reference video, but slightly improvised. The icon seems a little faint. I'm wondering if I should thicken the lines. I put it in the tool bar, because it is a tool and not just a setting. |
Both these seem interesting. |
@dellus nailed, what I already meant on Zulip, that this may be more complex than it looks on first sight. We have no similar function in LibreCAD currently, both mentioned features don't work like common snap functions. For these new features we can't implement them the same way. In a complex drawing, finding imaginary intersection or middle points on each mouse move event, will end in drastic rise of computing time and therefor slow down GUI reaction time. Also there would be a bunch of snap points for which it is not obvious to which entities they belong. So these features need a new implementation. They work more similar to trim function or tangent drawing tools. The user must activate this function, then select two entities and the resulting intersection or middle point must be sourced to the active function. This can be drawing or modifying functions, so these features have to be implemented for all kind of tools and functions. Some tools need one point, some two and others even more. But possibly these imaginary points are not needed for all points of an action. So a kind of single shot activation would be appropriate I think.
So this is a nice case study and a good training project, but far from implementation in main code base. With all that said, I expect, that this feature will never be realized for LibreCAD 2. |
I can surely tackle it if I correctly understand it's implementation. A graphical representation would surely help. |
@lordofbikes Instead of sourcing the point, can't the other tools just read the zero-marker position instead? Maybe set the zero-marker position as a private variable, and create a public Or create a slot function to pass that information through a variable by reference? These tools basically (in the end) just re-position the marker, that's all! It is indeed a very nice case study. While I do not hope for its implementation, I will still try to create those two tools in my free time. I'm wondering if I should create pull-requests for those two tools, or if there is another means of publishing it? |
"Point A to the middle of point B and C? I'm assuming here that you are talking about the Snap to perpendicular basepoint tool?" |
Now I've understood it, and to me, that seems doable. But the question is, how do I implement the connectivity (sending data from one tool to another)? Earlier I've mentioned two options. But @lordofbikes is not fond of adding snippets to all the action tool files. Without touching the other tool files, the only other option that I can think of is deliberately simulating a mouse-click, using the https://stackoverflow.com/questions/21680565/qt5-c-automated-mouse-clicking Now, that seems more like a hack than a conventional solution. Wonder if that's acceptable? |
I've created the other two mentioned tools; though they're just standalone for now.
Code : melwyncarlo@e8a99a4 Video link : https://youtu.be/tim_ZlNXp5E
Code : melwyncarlo@86b5828 Video link : https://youtu.be/pkdx8qKABLw |
Oh sweet dreams... |
I think that this could be a specific branch, or even a fork of LibreCAD for this purpose. |
@gerardbm My changes are merely less than 1% of the total code. 😄 |
@dellus Not fantasies, it is possible; and no subversion, just tactical fixtures. |
Could this be added (merged) in the version 2? |
* Advanced Snap Middle Manual Tool * Update rs_actionsnapmiddlemanual.cpp * Update rs_actionsnapmiddlemanual.h * Update lc_actionfactory.h * Update lc_actionfactory.cpp * Update rs_actionsnapmiddlemanual.h * Embedded the tool * Embedded tool - Made some corrections * Embedded tool - Tiny code addition to disable tool button * merging * cleanup * cleanup --------- Co-authored-by: Melwyn Francis Carlo <melwyncarlo@gmail.com> Co-authored-by: Melwyn Francis Carlo <66683108+melwyncarlo@users.noreply.github.com>
Merged. Closing now. |
This tool can snap (set) the relative-zero marker in the middle between two points chosen by the user.
The middle point, by default, rests at a poistion 50% relative to the position of the first point chosen, that is, at the center of the imaginary line connecting the two user-defined points.
This percentage, however, can be modified by the user in order to place the marker at a different position along the imaginary line.
Video link : https://youtu.be/XZU929ykxvg
In the video, the dotted lines seemed too faint, so I changed them to dots-and-dashes, as seen below: