FreeCAD
FreeCAD copied to clipboard
Show the normal vector of datum planes
Preliminary PR to see if there's some interest in this feature.
In order to let the user know the plane orientation draw the normal vector in the center. The vector is only drawn when the edit panel is open to avoid cluttering the 3D view.
Here's how it appears:
Much inspiration was drawn from Solidworks.
Hi, there is at least one open issue/feature request #6046 for this. I found it 2 days ago and posted my proposal how it could look like. There are also forum discussions about this, e.g. Datum Plane orientation request. My feeling is that it would be welcome but so far nobody did the work. Perhaps you can get in touch with chrisb. Hee seems to approve this idea, is experienced and deeply involved in FreeCAD and might be able to advise how to go on and push your work.
@macdroid53 uses this https://github.com/FreeCAD/FreeCAD-macros/blob/master/Information/DatumPlaneLocalAxis.FCMacro to the best of knowledge which not only shows the normal but all three local axes.
This macro is nice, but it feels more like a workaround with several issues:
- The main issue is, that you don't see the coordinate system at creation time. But I think this is the most important part. Setting up a DatumPlane (I counted 22 variations of DatumPlane configuration) can be tricky and this is the reason why there should be a visualization of the DatumPlane with some sort of coordinate system WHILE creating it. Once created the way you want it, the coordinate system becomes less important. The DatumPlane (and e.g. sketches placed on it) will simply behave as expected, due to your setup. But this can be discussed.
- The tree becomes cluttered with additional elements. This would not be necessary if the visualisation of the coordinate system is part of the DatumPlane visualization itself.
- Only a small detail: After changing the DatumPlane configuration the coordinate system added by the macro relies on 'Refresh' to update its position.
Perhaps a full coordinate system with the default look of a LCS is better then my proposal in #6046 but it should definitely be visible during creation. It could become invisible once created. And for the rare? cases where you really want a persistent visualization of the DatumPlane coordinate system, place a property in the view tab:
@DrD4ffy you have completely misunderstood my comment, you were referencing another user from the forum and I was advising that @macdroid53 is someone who might find this kind of thing useful and therefore give fuller feedback. I wasn't saying that the macro should be used as the basis for the PR, sorry if I need to explain myself more in future or maybe best I just don't bother.
Random comments:
- The macro is a workaround
- The LCS (not just the normal) should be shown during creation of both sketches and Datum planes
- The LCS (not just the normal) should be available on demand for both sketches and Datum planes
- The LCS (not just the normal) should be available on demand for almost any entity
- Possibly, the option to have just normal or LCS would be appropriate
- The LCS should be a visualization tool for entities, it shouldn't be a entry in the tree view.
(I'm switching this to Draft so we don't accidentally merge it while discussion is ongoing... please switch it to "Ready to Review" when it's solidified.)
Many (if not every) CAD program show only the local Z axis for planes, I actually never felt the need to know where the other two axes are pointing towards.
From the code point of view the AxisCross is able to show the whole LCS if that's really what people need.
My main questions were:
- The axis size is now invariant of the zoom level, IMO following the geometry scaling feels better
- Do we want to always display the normal direction? Or only during the editing phase? The former may clutter a bit the view if many planes are used.
- re what to show, do we want an option to choose between normal or LCS? A global or per-object property?
Most of the time the x/y aren't needed. But, there are occasions where it is quite helpful. For example, when using MapMode dialog to arrange the location of a sketch, the LCS of the sketch allows the visualization of where the rootpoint and x/y orientation of the attachment mode. Being able to display the lcs of a sketch on demand allows the same to visualized outside the Map mode dialog. Currently for faces it is a PITA to figure out what the normal is.
If possible, this could be added to sketch planes as well. There only x, y is interesting (or h, v as it is called in sketcher) https://github.com/FreeCAD/FreeCAD/issues/11781#issuecomment-1868249260
If possible, this could be added to sketch planes as well. There only x, y is Überresten (it h, v as it is called in sketcher) #11781 (comment)
My original comments in the forum was about some sort of visual representation of the sketch location (outside sketcher).
I rarely use Datum planes. But, in the case of both the plane and the sketch having a visual of the orientation and a 0,0,0 location would be quite useful on occasion.
In the sketch (or even Part>Attachment) case, when advanced map modes are being set up a clear representation of the direction of x/y/z would make the use of map mode much clearer.
Yes, it should be visible on active sketches and also if the sketch is not active (open to be edited). Of course as preference to set is to display the axis cross or not.
Seeing the orientation of the X/Y axis is why sooooo many people find Map mode absolutely frustrating to use. Have a look at these tutorials, when using any of the advanced map mode where the X/Y are pointing are left to the imagination by the gui. https://wiki.freecad.org/Basic_Attachment_Tutorial https://youtu.be/jfhgcDcAAlk?si=a9RKfiqS-TIbsViX https://youtu.be/5dPL3Cr_Xf0?si=JPtX7QpnLCTBQxeF https://youtube.com/playlist?list=PLXUHsWZ5PthBiKBymLUf5hd8DxQMK8cDG&si=aaTWMwQaEmySO2_s
Well, let's start from the easy things first. Let's assume that once written the "thing" can be applied to any planar surface in any mode.
What should be the graphical representation of the LCS? A planar representation is IMO preferable as it'd generate less on-screen clutter, otherwise a classic 3D axis representation with the colored arrows is also possible.
The next step would be to understand when to show the LCS.
Perhaps it's time to summon the UX design group @obelisk79
It should be available, via toggle, for any entity where it might be useful; sketch, datum, face. (possibly a right click) It should be presented when creating a new sketch or datum. (Optionally, global setting in prefs to disable/enable) It should be available when using the Map mode dialog, probably the Placement dialog. Maybe others...
If I had to vote I would definitely opt for a full 3 axis LCS in map mode dialog. Apart from map mode dialog: it might be less important, but no matter where it is shown, we are talking about LCS. So, for consistency all over the program, I think LCS should always look the same.
When just creating a datum plane, I think just the direction of the normal should be visible. While we're on the subject "Flip Normal" should just have a toggle button instead of the oddly chosen checkbox, which exists at the very bottom of the task panel(should probably be close to the top. Regarding showing the full LCS, it can also have a toggle with default to have it not shown.
The idea here is to default showing the minimal useful information. Understanding the direction of the normal vector seems much more vital compared to the LCS which is likely less frequently useful/desired.
A Datum can be attached/mapped with all the same modes as a sketch. So, being able to see which way all axes points, can be of interest.
When just creating a datum plane, I think just the direction of the normal should be visible.
I understand the intention of not cluttering the screen but “just creating” a datum plane? A datum plane HAS an X direction and it HAS a Y direction. Only displaying the normal when defining it means leaving two out of three axes to chance.
@DrD4ffy how often is the orientation of the X/Y really a problem? I don't use many datum planes, but I manually position a lot of sketches, and I rarely care how they are oriented as long as I understand how they are oriented in relation to the rest of my model which should be visually apparent.
Am I incorrect by assuming that this is a concern when attaching sketches to the planes? I don't want to sound negative here, but I find the axis representation of the LCS in FreeCAD to be woefully ineffective. I have not programmed my brain to look at the colors and recognize the axis they represent after the last 3 years of working in FreeCAD.
I can't be the only person who would only effectively understand the direction of the normal from the LCS being present. Now, if the LCS was displayed with X, Y, and Z labels that would be different.
Advance use of Datum planes can be as advanced as sketch placement. If you are locating the DP on some off angle face, then it is important to know which way is X/Y. will end up Just as it would be for a sketch. In the case of a DP, where you might want to attach a sketch, then being able to determine if the X/Y of the sketch s going to end up as you want/expect on the DP is important.
@macdroid53 that's fine, I would just say that the LCS needs to also display with text labels and not just be 3 colored lines.
I don't feel strongly for or against. If the text can be done unobtrusively, but red/green/blue is good enough for me. They indicate the positive direction of each axis. But, that paradigm needs to be maintained throughout. But, then there's the color blind issue...
@obelisk79 My argument was not so much that X/Y are just as important, but that they are simply part of a complete definition. Then it doesn't matter whether it's a sketch or a DP, but rather that you understand what you are doing in the attachment dialog.
As for the axes colors: In the beginning, I had trouble remembering what was what. I turned on the little CS to see axes with labels. Eventually I was able to memorize "red=X", but I understand anyone who says "I need labels".
I'm pro labels and also in favor of all three axis, to see also the rotation.
That is a very good point. Both DP and Sketches can be rotated. The axis cross would make this clear.
I've created an issue for the display of the origin axis system / default planes https://github.com/FreeCAD/FreeCAD/issues/12584 Maybe an overhaul of the origin display could be used also for datum planes, sketches and local coordinate systems in assemblies to have a unified appearance throughout the entire application?
Consistency throughout FreeCAD is a good thing.
@LemonBoy any news on this? Will you resume and implement an axis cross? And just a heads up for the upcoming feature freeze: If you want this draft PR to be considered for a version 1.0 release, it should be marked ready for review by Monday, 2024-06-03 at the latest. (further details in the 1.0 feature freeze forum announcement).