How DatumPlane's supposed to be displayed
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
How DatumPlane's supposed to be displayed
Hello, now I'm adding the origins to the body, generally it wasn't too hard... But now I'm a bit stuck with the visualization of origin and datum sizes... They are both depend on the bounding box of internal objects, so I want to handle them in a common way. Also now the ViewProviderDatum's are notified that they need to update size by updateData(<placement property>), which is a bit hacky, so I want to refactor that to...
As for implementation of ViewProviderDatumPlane::updateData, the plane supposed to be displayed as any of basic shapes listed here:
http://cococubed.asu.edu/code_pages/raybox.shtml
But due to a mistake in it (the bounding box is rotated rather than the basepoint/normal), the output happends always to be a rectangle.
So now I can either fix the code, so plane will have different shape depending on it's intersection with bounding box or simplify it: the same result as now may be achived in a couple of dozens of lines (the current code is more than 150 lines)...
What do you think?
As for implementation of ViewProviderDatumPlane::updateData, the plane supposed to be displayed as any of basic shapes listed here:
http://cococubed.asu.edu/code_pages/raybox.shtml
But due to a mistake in it (the bounding box is rotated rather than the basepoint/normal), the output happends always to be a rectangle.
So now I can either fix the code, so plane will have different shape depending on it's intersection with bounding box or simplify it: the same result as now may be achived in a couple of dozens of lines (the current code is more than 150 lines)...
What do you think?
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: How DatumPlane's supposed to be displayed
I think a rectangular shape is all right, as it is quite easy to understand its orientation. As for the true intersection with bounding box cuboid, I don't know. I think I want to play with it a bit before giving preference to one or the other.
Re: How DatumPlane's supposed to be displayed
I would prefere a minimal rectangle, means a rectangle with minimal width and hight to enclose the part (plus some margin). It should also always contain the origin (0,0,0) The reason for this is that a rectangle will always be recocnized as a plane, so there is no confusion like "what is this strange shape", it provides a clear and recognizable visual aid. And including the origin is imho important to get a feeling where the named origin really is if the single body of the part is somewhere non-centric.
Re: How DatumPlane's supposed to be displayed
Slightly unrelated but still quite close to the subject. As sometimes objects can have proportions where for example length is much bigger compared to width/height 2 planes could become too small in that condition? Therefore probably bounding box is one criteria to determine the plane size but there should be additional criteria like for example "min-size" based on screen size?Fat-Zer wrote:But now I'm a bit stuck with the visualization of origin and datum sizes... They are both depend on the bounding box of internal objects, so I want to handle them in a common way.
And i am not sure if this is DatumPlane related but in PartDesign NEXT default sketcher area when entering the sketch for inserting sketcher geometry is appropriate for inserting sketcher geometry at about 1mm * 1mm size. Default sketcher area size probably could be bumped up a bit.
Re: How DatumPlane's supposed to be displayed
Yes, I think rectangular planes are better too... So I'll keep them... Note that due to implementation the rectangle is minimal (+0.1 marging) for planes parallel to the baseplanes, for others it is larger (up to sqrt(3) times for worst case). To calculate the best case for any position of the plane will be too time-hungry... I suppose it will be still possible to enhance the current a bit, but I don't yet know how exactly...ickby wrote:I would prefer a minimal rectangle, means a rectangle with minimal width and hight to enclose the part (plus some margin).
Doesn't quite understood that... are you talking about Origin's planes or Datums?triplus wrote:Slightly unrelated but still quite close to the subject. As sometimes objects can have proportions where for example length is much bigger compared to width/height 2 planes could become too small in that condition? Therefore probably bounding box is one criteria to determine the plane size but there should be additional criteria like for example "min-size" based on screen size?
This one is not related... It's because PartDesign implements it's own new_sketch command with an object picker, which doesn't sets the viewport correctly after the creation. IMHO it's subject to fix... remind that a bit later...triplus wrote:And i am not sure if this is DatumPlane related but in PartDesign NEXT default sketcher area when entering the sketch for inserting sketcher geometry is appropriate for inserting sketcher geometry at about 1mm * 1mm size. Default sketcher area size probably could be bumped up a bit.
Re: How DatumPlane's supposed to be displayed
Please pardo the intrusion,
I'd like to suggest that we keep the rectangular shape, but add transparency please (it's been a while since I used this branch, but last time I used it I was unable to change transparency even in the Object's properties from GUI.)
Also, if someone finds it interesting/useful here's Siemens NX implementation of planes: https://docs.plm.automation.siemens.com ... om_plane_d
I'd like to suggest that we keep the rectangular shape, but add transparency please (it's been a while since I used this branch, but last time I used it I was unable to change transparency even in the Object's properties from GUI.)
Also, if someone finds it interesting/useful here's Siemens NX implementation of planes: https://docs.plm.automation.siemens.com ... om_plane_d
Need help? Feel free to ask, but please read the guidelines first
Re: How DatumPlane's supposed to be displayed
Basically Origin Planes and Datum Planes. True i gave example for Origin Planes but as for Datum Planes imagine user creates "small" 2D cross section on it and after extrudes is by using "big" value. If bounding box is the only criteria for the plane size what probably can happen is plane becomes to small to be usable without user zooming in first.Fat-Zer wrote:Doesn't quite understood that... are you talking about Origin's planes or Datums?triplus wrote:Slightly unrelated but still quite close to the subject. As sometimes objects can have proportions where for example length is much bigger compared to width/height 2 planes could become too small in that condition? Therefore probably bounding box is one criteria to determine the plane size but there should be additional criteria like for example "min-size" based on screen size?
issue #0002244This one is not related... It's because PartDesign implements it's own new_sketch command with an object picker, which doesn't sets the viewport correctly after the creation. IMHO it's subject to fix... remind that a bit later...
Re: How DatumPlane's supposed to be displayed
Remember:
ViewProvider can have additional Properties. So, if there is a long discussion about the right way, just make it configurable.
And if you use some kind of margins, never use absolute values. Always try to use things like 1% of the BoundingBox...
ViewProvider can have additional Properties. So, if there is a long discussion about the right way, just make it configurable.
And if you use some kind of margins, never use absolute values. Always try to use things like 1% of the BoundingBox...
Stop whining - start coding!
Re: How DatumPlane's supposed to be displayed
Datums are semi-transparent by default for a quite a long time (I haven't seen them solid)...drei wrote:Please pardo the intrusion,
I'd like to suggest that we keep the rectangular shape, but add transparency please (it's been a while since I used this branch, but last time I used it I was unable to change transparency even in the Object's properties from GUI.)
I've just today made them support common object properties like color and transparancy... Also I've slightly changing their default color: the current one (E6E621) is too near to the highlight color (E1E114), I've set the "golden yellow" (FFD700) and increased their transparency to 60, for planes it was 50, and for lines — 20. Also I've disabled transparency for the points due to it completely broke them (because of SoMarkerSet)... Also note that points a lack of highlight...
Re: How DatumPlane's supposed to be displayed
Probably we are talking about slightly different thing.jriegel wrote:Remember:
ViewProvider can have additional Properties. So, if there is a long discussion about the right way, just make it configurable.
And if you use some kind of margins, never use absolute values. Always try to use things like 1% of the BoundingBox...
1.) General behaviour and minimal sizes of planes in 3D View.
2.) Property for each individual plane. For user to control individual plane size.
As for option 2:
Yes i agree for this it could make sense to be done in percentages compared to original size that is determined by BoundingBox.
As for option 1 (initial proposal):
I think it would not help much in this use case to have the possibility to set for example BoundingBox + 10% to set the plane size. Small plane would still be small. Min-size general property therefore should be calculated based on 3D View window size and if the plane is bigger BoundingBox is the only criteria that determines how big it should be. Therefore if user would set min-size to 5 what FreeCAD would do is it would never show plane in 3D View smaller of 5% of the 3D View size.
P.S. I don't have strong opinion on this. I just thought i will mention possible use case to discuss. But it is true i am not aware of implications and performance penalty and how should actual implementation be done or behave. There is a chance other users would always like to zoom in in such use cases instead of having min-size for planes as a general option. If that is true i am fine with that.