FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

Show the normal vector of datum planes

Open LemonBoy opened this issue 1 year ago • 12 comments

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: Preview

Much inspiration was drawn from Solidworks.

LemonBoy avatar Feb 08 '24 16:02 LemonBoy

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.

DrD4ffy avatar Feb 09 '24 08:02 DrD4ffy

@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.

Syres916 avatar Feb 09 '24 23:02 Syres916

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: grafik

DrD4ffy avatar Feb 10 '24 07:02 DrD4ffy

@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.

Syres916 avatar Feb 10 '24 10:02 Syres916

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.

macdroid53 avatar Feb 10 '24 12:02 macdroid53

(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.)

chennes avatar Feb 12 '24 17:02 chennes

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?

LemonBoy avatar Feb 12 '24 21:02 LemonBoy

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.

macdroid53 avatar Feb 12 '24 22:02 macdroid53

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

maxwxyz avatar Feb 16 '24 06:02 maxwxyz

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.

macdroid53 avatar Feb 16 '24 13:02 macdroid53

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.

maxwxyz avatar Feb 16 '24 14:02 maxwxyz

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

macdroid53 avatar Feb 16 '24 14:02 macdroid53

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

LemonBoy avatar Feb 22 '24 08:02 LemonBoy

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...

macdroid53 avatar Feb 22 '24 12:02 macdroid53

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.

DrD4ffy avatar Feb 22 '24 16:02 DrD4ffy

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.

obelisk79 avatar Feb 23 '24 19:02 obelisk79

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.

macdroid53 avatar Feb 23 '24 20:02 macdroid53

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 avatar Feb 23 '24 20:02 DrD4ffy

@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.

obelisk79 avatar Feb 23 '24 23:02 obelisk79

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 avatar Feb 23 '24 23:02 macdroid53

@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.

obelisk79 avatar Feb 24 '24 00:02 obelisk79

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...

macdroid53 avatar Feb 24 '24 01:02 macdroid53

@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".

DrD4ffy avatar Feb 24 '24 07:02 DrD4ffy

I'm pro labels and also in favor of all three axis, to see also the rotation.

maxwxyz avatar Feb 24 '24 07:02 maxwxyz

That is a very good point. Both DP and Sketches can be rotated. The axis cross would make this clear.

macdroid53 avatar Feb 24 '24 13:02 macdroid53

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?

maxwxyz avatar Feb 24 '24 13:02 maxwxyz

Consistency throughout FreeCAD is a good thing.

macdroid53 avatar Feb 24 '24 13:02 macdroid53

@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).

maxwxyz avatar May 15 '24 18:05 maxwxyz