Using LCS in TechDrawViews

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Using LCS in TechDrawViews

Post by user1234 »

wandererfan wrote: Wed Dec 28, 2022 6:49 pm I think I need some cartoons that show what the LCS would do or how it would be different from the current situation.
An other try.

The positions of the dimension and detail depends of the x=0 and y=0, which is the middle of the view. If the size of the view changes, the (value) positions are still the same, but since the x=0 and y=0 point changes, the the real positions changes (but not the value). The suggestions is about, to define the x=0 and y=0 point (for example on the left side of the shaft), not to view it (if then, then a point is more then enough).

length of the shaft = 50mm
before_change.png
before_change.png (185.71 KiB) Viewed 1455 times

change the length to 100mm
after_change.png
after_change.png (211.42 KiB) Viewed 1455 times

a video while changing the length in a horizontal split view 3D and TechDraw
Peek 2022-12-29 15-53.webm
(102.35 KiB) Downloaded 43 times

file
test52_TechDraw_positions_2.FCStd
(13.19 KiB) Downloaded 41 times

Greetings
user1234
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Using LCS in TechDrawViews

Post by FBXL5 »

An example:

I have an oddly shaped object with an oblique hole through it.
Now I want to see the true angle between the hole and the bottom face and then the true shape of the hole cross-section.

The true angle can be seen when the object is cut along the hole. Therefore the section line will be placed on the lowest edge that runs from point a to point b.
The views show the view origin and coordinate axes via 2D cosmetic lines (X = yellow and Y = light blue). 3D cosmetic lines show the prjected coordinate axes of the global coordinate system (X = red, Y = green and Z = blue).

The angle needed for a simple section can be measured between line a-b and the X axis. In this case a local CS should lie at the position of the projected global CS and with the same orientation.
The section line is by default placed at the view's origin and has an offset of 0.32 mm from the line a-b; this is must be corrected manually with a tolerance that depends on visua power. :(
At least we have a section view to measure the true angle of the hole:
Snip macro screenshot-09691b.png
Snip macro screenshot-09691b.png (44.31 KiB) Viewed 1384 times
A-A shows that the global CS is misplaced within a correctly orientated view. :shock:

But it is correct if the Rotation property is set to 0°. This is a con based on the fact that the view origin is the bound box center and the orientation is allways that of the page.
Snip macro screenshot-8a1fa4.png
Snip macro screenshot-8a1fa4.png (24.27 KiB) Viewed 1384 times
The representation of the globa CS via 3D cosmetic lines makes no sense if they don't rotate with the view.

With this orientation it is possible to create section B-B displaying the true shape of the hole, at least (but it doesn't create a section line ):
Snip macro screenshot-bcecde.png
Snip macro screenshot-bcecde.png (47.2 KiB) Viewed 1384 times
A correctly orientated section A-A wouldn't create the expected view. :(

And so I'm convinced that a local CS is needed. One that rotates with the view and, as a base, connects to other geometry to position them accordingly.


@wandererfan Now I notice that I could have intruduced projection lines and reference lines for terminology reasons.
The projection line leads from the base view to the derived view and represents the view direction (dotted black in the last image).
The reference line defines the base plane of the derived view and is a base for dimensions to transfer from one view to another (dotted orange in the last image).
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Using LCS in TechDrawViews

Post by FBXL5 »

@wandererfan
Another point of view:

If we had a Local CS the views all projection can be made according to this LCS and if this is rotated all projected geometry will follow.

The View CS will always stay oriented the same as the page and acts as a transformation layer to place the projected geometry on the page.

If I could program this it would work like:

1. Place a view on the page. VCS and LCS are identical.
2. Project selected geometry according to the LCS.
3. Derive the bounding box of the projection. This might lie outside the page now.
4. Transfer the LCS in relation to the VCS. The bounding box center and the origin of the view (VCS) should now be identical.

Now annotations can be placed according to the VCS as they usually don't need to rotate.

If the view needs to be rotated the translation/transformation between LCS and VCS can be changed in a way that said bounding box center stays on the VCS origin and the LCS is moved around accordingly. Now the projected geometry technically follows the LCS but stays in place in relation to the VCS while the annotations don't move; leader lines might need to be rearranged manually until a function is implemented that allows the tip of the leader line to follow the element that it is attached to.

The LCS is a 3D coordinate system behind the scenes with an orientation according to the global CS and its XY plane (contains and so) determines the orientation of the projected geometry.
Whenever we add geometry manually such as cosmetic lines it will be placed relative to the LCS and the coordinates of the defining points can easily be found on said XY plane in the 3D space.
This can be useful to define a section line in the view and to transfer the start, corner, and end points into 3D to create the section planes.

The LCS could be used to attach (place and orient) further graphical elements that have to follow the projected geometry. A "Drafter", the 2D version of the sketcher, could be used to draw section lines, frames for break-out views and detail views, (hidden) lines to define AuxView directions, and lines for wiring plans or diagrams.

If each view had its own 3D LCS in the background that defines its position within the global CS then it should be possible to derive new auxiliary views from any other view by chaining up all transformations in between.
This might be the missing link to create an AuxView tool.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Using LCS in TechDrawViews

Post by wandererfan »

@FBXL5 & @user1234

I've picked this up to work on it a couple of times now and had to put it down because I don't understand the issue.

Without using the term LCS or specifying a solution, my understanding of problems to be solved is something like this:
- 2d cosmetic geometry is specified in the coordinates used to draw the View (X horizontal, Y vertical). If any aspect of the View changes (ex direction, rotation, scale), the cosmetic coordinates are not changed to match. Drawing coordinates are of limited usefulness to the user.
- 3d cosmetic geometry does not respect rotation (or scale?) and is converted to 2d geometry that is only accurate at creation time.
- the orientation of derived views (ex sections) are specified in terms of global XYZ. It would be more convenient to describe them in terms of the parent view.
- the existing view centerlines (aligned to the drawing coordinates) are not useful. At the least, they should reflect rotation and scale used.
- it is desirable to show the alignment of the global axes on a view.

There are other aspects that I get glimpses of, but don't really grasp.
- there is a need to measure angles that can't be done easily now. I'm not sure if solving the above points would resolve this or not.
- the is a problem with centre of the View being (0, 0) instead of (x1, y1) (?). Maybe this is just having the location of the source object available in order to ??????

Is any of this correct?
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Using LCS in TechDrawViews

Post by user1234 »

Dislaimer: my english is OK, but sometimes it is hard to follow.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm Without using the term LCS
I also would not call it LCS.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - 2d cosmetic geometry is specified in the coordinates used to draw the View (X horizontal, Y vertical). If any aspect of the View changes (ex direction, rotation, scale), the cosmetic coordinates are not changed to match. Drawing coordinates are of limited usefulness to the user.
True.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - 3d cosmetic geometry does not respect rotation (or scale?) and is converted to 2d geometry that is only accurate at creation time.
False, if you mean with 3d cosmetic geometry for example a sketch or other 3d objects.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the orientation of derived views (ex sections) are specified in terms of global XYZ. It would be more convenient to describe them in terms of the parent view.
Yes and no, only the origin, not the orientaion of the system, it should be default X annd Y.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the existing view centerlines (aligned to the drawing coordinates) are not useful. At the least, they should reflect rotation and scale used.
This have in the end nothing to do with this suggestion, they should respect the elements how they produced (parametic). But this is a TNP issue.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - it is desirable to show the alignment of the global axes on a view.
No.


wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the is a problem with centre of the View being (0, 0) instead of (x1, y1) (?). Maybe this is just having the location of the source object available in order to ??????
When i understand you correct, this is all about. The x0, y0 in the drawing view should be defined by the user from 3D nothing more.


As i said before, i can explain it with a via video call (jitsi is FOSS). The next 1week + 1/2week i am available, at least this is my working plan atm.


Greetings
user1234
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Using LCS in TechDrawViews

Post by FBXL5 »

I think user1234 is concerned about shifting cosmetic geometry or the fact that it doesn't rotate in step with the view.

My concern is about being able to flip through auxiliary views to show true lengths or true shapes of geometric elements.
It is about using an intermediate coordinate system to bind all geometry that has to rotate with the view and use the existing coordinate system for elements like annotations that do not need to rotate. Neither should be visible by default, but there are special cases where it might be useful to display a representation of local or global axes (just a wee portion starting at the origin).
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - 2d cosmetic geometry is specified in the coordinates used to draw the View (X horizontal, Y vertical). If any aspect of the View changes (ex direction, rotation, scale), the cosmetic coordinates are not changed to match. Drawing coordinates are of limited usefulness to the user.
- 3d cosmetic geometry does not respect rotation (or scale?) and is converted to 2d geometry that is only accurate at creation time.
This is how it seems to be done now.
If cosmetic geometry doesn't rotate with the whole view it is worthless as the current view origin and the current view axes. The goal should be to bind all of them to an element of 2D geometry that rotates in step with the projected image of the model.
In my imagination this is represented by two axes of a coordinate system and I would call it a LCS.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the orientation of derived views (ex sections) are specified in terms of global XYZ. It would be more convenient to describe them in terms of the parent view.
I'm not sure but I tend to say that the orientation and the placement as well should be "specified in terms of global XYZ". But their vectors should be extracted from measured values such as angle and offset of the parent view's geometry.
If angles and offsets are measured against a LCS (as described above) it wouldn't matter how the view is rotated.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the existing view centerlines (aligned to the drawing coordinates) are not useful. At the least, they should reflect rotation and scale used.
Yes. If they'd reflect rotation they could help to align with the parent view if desired.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - it is desirable to show the alignment of the global axes on a view.
Yes, if you design aviation or automotive parts you need to check the position and alignment of the part against the global coordinate system of the aircraft/carriage which has to be included in the document (usually the GCS of the document). Its offset can be large and so you would show it, check it, and hide it immediately afterwards, because it enlarges the view massively.
You could check if a view lies parallel to a grid plane by looking at the representation of the GCS: If more than 2 axes are visible the view is not parallel. OK, this can be done by looking at the vector and rotation angle, too.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - there is a need to measure angles that can't be done easily now. I'm not sure if solving the above points would resolve this or not.
As above, sometimes it is useful to check angles and offsets against coordinate systems. It might be required to be documented on the drawing. The view coordinate system is worthless in such a case.
If you have a LCS "specified in terms of global XYZ" of which the XY plane is displayed in the view you can draw a section line and measure its start and end point against the LCS's X and Y axes. Their coordinates can be transferred back into 3D space by a "little bit" of vector math or directly via a suitable corresponding 3D element like a PartDesign plane or a PartDesign CoordinateSystem. An edge created from the 3D points in connection with the supporting element could be used to extrude a section plane.
In my imagination an intermediate coordinate system would help to resolve measuring issues.
wandererfan wrote: Thu Jan 19, 2023 7:05 pm - the is a problem with centre of the View being (0, 0) instead of (x1, y1) (?). Maybe this is just having the location of the source object available in order to ??????
The view center has X and Y offsets from the page coordinate system (controlled by the user) and a LCS would have X and Y offsets from the view coordinate system (computed automatically so that the center of the view and the center of the bounding box of the model's projection are identical). If the view has to be rotated it would be around the center of the view. The LCS (including all bound geometry elements) would follow since it is attached to the view.


I tried to describe a way how a workflow to derive auxiliary views (and similar for sections) could look like and I am quite convinced that an element like a LCS or similar is the key to create the needed funktion. (And provide a support for auxiliary geometry instead of only cosmetic)
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Using LCS in TechDrawViews

Post by user1234 »

@wandererfan : according issue #8878, i was always wondering, how the big CADs determinate which face, edge, vertex is connected to a dimension in 2D to 3D. I rarely see, that similar/near coordinates objects gets mix-up. When 3D and 2D share the same Origin, then maybe it is determinate while creating, on which geometry element the dimension should link.


2023-03-14_09-17.png
2023-03-14_09-17.png (190.92 KiB) Viewed 891 times

2023-03-14_09-16.png
2023-03-14_09-16.png (180.33 KiB) Viewed 891 times

file.FCStd
(19.41 KiB) Downloaded 25 times

Greetings
user1234
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Using LCS in TechDrawViews

Post by wandererfan »

user1234 wrote: Tue Mar 14, 2023 8:45 am When 3D and 2D share the same Origin, then maybe it is determinate while creating, on which geometry element the dimension should link.
As long as we know the reference point for both, we can convert from one to the other.

I've abandoned two attempts so far to use the same coordinate system for 2d and 3d. :(

The actual drawing isn't much of a change, but keeping dimensions, balloons, leaders, etc lined up gets messy, especially when the placement of the source changes.

I'll go back to this once dimension reference corruption is sorted out.
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Using LCS in TechDrawViews

Post by user1234 »

wandererfan wrote: Wed Mar 15, 2023 1:11 pm As long as we know the reference point for both, we can convert from one to the other.
Do you mean a pointer, or a coordinate?


Greetings
user1234
Post Reply