Complex Sections

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

wandererfan wrote: Fri Dec 02, 2022 3:02 pm I have something in development that adds a Rotation property for Hatches. So far, just for Svg and Bitmap hatches.
Excellent. Rotated hatch patterns to distinguish between several parts in an assembly are really usefull.

The rule I learned decades ago: A pattern orientation of a specific part must not vary from one setion view to another. That means the fixed angle depends only on the page orientation. A different orientation would mark another part.
This way it is easy to find a specific part in a large assembly drawing displaying many section views each cutting through varying combinations of parts. A cut Thingy will allways have the 45° pattern while the Thingamajig has a -45° pattern in every view.

Therefore a Rotation property should rather depend on the page orientation than on a view orientation.

rock.vice wrote: Fri Dec 02, 2022 2:45 pm
On first sight I thought the second from right section was wrong having two differently orientated Patterns, but then I took a ruler and realised that it is the same pattern and orientation on both sides. Nice optical illusion :roll:
user1234
Veteran
Posts: 3337
Joined: Mon Jul 11, 2016 5:08 pm

Re: Complex Sections

Post by user1234 »

Hello!

While testing/using this new features, i found 3 issues:

- the direction of the section (complex and normal) is incorrect. Everytime i set it up, it resets always to the wrong direction (when you go in the task of the section it is resetted).

1.png
1.png (237.02 KiB) Viewed 1519 times


- when you change the position of the view, it recalculates the view completely, this is new and was not before.

2.png
2.png (222.77 KiB) Viewed 1519 times

- when recalculating a view, FreeCAD block again as before the multithreading implementation. Also the recalculated view does not vanish as before (this could be intend, i do not know).

Do not bother with the extra lines from the hlr.

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.21.31191 (Git)
Build type: Release
Branch: master
Hash: 53804d7e4db820048b9eba258ef605cd84c0a6e1
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, Vtk 9.0.1, OCC 7.6.3
Locale: English/United States (en_US)

Greetings
user1234
Attachments
CylinderBase.FCStd
(546.18 KiB) Downloaded 28 times
2D_CylinderBase.FCStd
(9.07 KiB) Downloaded 27 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

user1234 wrote: Sat Dec 03, 2022 5:54 pm - the direction of the section (complex and normal) is incorrect. Everytime i set it up, it resets always to the wrong direction (when you go in the task of the section it is resetted).
Your base view is upside down and rotated and that is confusing the conversion from SectionNormal vector to angle on the View's XY in the dialog. The dialog behaves if the base view is right side up and not rotated. Still thinking on how to fix this.
- when recalculating a view, FreeCAD block again as before the multithreading implementation. Also the recalculated view does not vanish as before (this could be intend, i do not know).
Yes, I knew this one. It's on my list to put the making of the aligned pieces into a separate thread.

The recompute on move is a surprise to me. Not sure why this happens yet. There is code to prevent this.
user1234
Veteran
Posts: 3337
Joined: Mon Jul 11, 2016 5:08 pm

Re: Complex Sections

Post by user1234 »

wandererfan wrote: Sat Dec 03, 2022 8:37 pm Your base view is upside down and rotated
I did not any transform on this, the object itself is still 0, 0, 0, and not rotated at all.

wandererfan wrote: Sat Dec 03, 2022 8:37 pm The recompute on move is a surprise to me. Not sure why this happens yet. There is code to prevent this.
Generally while working on this, there are pretty on every editing a recalculation. For example while writing something in the field Format Spec (to add the degree symbol or add anything else), or delete a dimension (not when adding a dimension).

wandererfan wrote: Sat Dec 03, 2022 8:37 pm There is code to prevent this.
Thanks. Sadly i can only compile and test this today and a little bit tomorrow. Then i am 2 weeks away.

Greetings
user1234
user1234
Veteran
Posts: 3337
Joined: Mon Jul 11, 2016 5:08 pm

Re: Complex Sections

Post by user1234 »

@wandererfan: there is much more going on, atm the TechDraw state is pretty unusable (no offense, it is development).

- when adding a point or edit a vale in the properties, the more objects in it, the longer it takes. for a drawing i am atm. 1min 10s for each edit, minimum. Also while computing you can sometimes see jumping around dimensions. Just add a cosmetic point to test it.

- when i save a drawing (everything 3D models and drawing is calculated and up to date), close it and reload it, it destroys itself. That is also new.

reload.png
reload.png (239.96 KiB) Viewed 1416 times

Greetings
user1234
Attachments
CylinderBase.FCStd
(552.63 KiB) Downloaded 29 times
2D_CylinderBase.FCStd
(21.58 KiB) Downloaded 31 times
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

@wandererfan
I have compiled an examples page for sections: TechDraw_SectionExamples
In this step I concentrated on what can already be achieved using your reworked section tools and held down some odd behaviours.

Doing this I realised that TechDraw is missing a tool to create auxiliary views. But the section tools are almost ready to fill this spot.

In case you want to recreate some results:
Sections.FCStd
(106.06 KiB) Downloaded 30 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

FBXL5 wrote: Wed Dec 07, 2022 3:36 pm I have compiled an examples page for sections: TechDraw_SectionExamples
This is an terrific piece of work. Very helpful.

I think I have the default orientation of the simple section sorted. Have not looked into the positioning yet.
Attachments
autoRotateSection.gif
autoRotateSection.gif (356.33 KiB) Viewed 1247 times
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

wandererfan wrote: Thu Dec 08, 2022 12:10 am I think I have the default orientation of the simple section sorted. Have not looked into the positioning yet.
Excellent! I think positioning of the views is less important. Usually I had to find a big enough white space on a drawing to place the section view, if possible in the direction the arrows were pointing. But you could add the grid "address" to one of the the arrows where to find the section view on the drawing sheet and extend the view label with the grid coordinates of the section line.

But as mentioned on the wiki page: TechDraw is lacking a tool to create auxiliary views. At least the section tools can be (mis)used for this task. But if you want to define another aux view or use an aux view as a base view for a section the tools seem to fail.

The old school way to describe objects graphically is by a chain of views. Whenever unsure if a distance that should be measured is displayed with true length, add two auxiliary views and in the the second the distance is projected with its true length. That's why automotive drawings have lots of views and sections.

The modern way seems to be like rotating the 3D view and derive a view from the current camera direction and add "rotated" to the label. There will be no hint on the drawing how this view is connected with other views. This can be confusing if the 3D data is not available.

I think being able to build such chains of (auxiliary) views is an important step towards professional use.
user1234
Veteran
Posts: 3337
Joined: Mon Jul 11, 2016 5:08 pm

Re: Complex Sections

Post by user1234 »

I tested the PR#7972, see https://github.com/FreeCAD/FreeCAD/pull/7972.

The normal section works now correct, thanks.
The complex section still have issues, The rotation value are now correct in the task, but the rotation is still wrong (same as before).
About the recalculation the is a little bit of improvement, but still recalculate too often. For example while opening a file, FreeCAD still blocks, or open any section object (double click) abort the task with cancel (do nothing else), it still recalculates the view. Or what sometimes happens, when deleting a section object, the original view will be recalculated (intent, since the line is added to the view), but then it can happen, that the view must be recalculated twice (i do not find any kind a recipe for that behavior).

The last two commits are included in the tests (last commit fed8363)

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31251 (Git)
Build type: Release
Branch: fixSlowCS
Hash: fed8363a171c96ba74eda6cb28ce0aace1f30e8b
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, Vtk 9.0.1, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * QuickMeasure 2022.10.28
Greetings
user1234

edit: forgot the screenshot
2022-12-08_20-58.png
2022-12-08_20-58.png (276.97 KiB) Viewed 1153 times
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

@wandererfan I'm sorry but I'm still excited about being able to use "sections without cutting" for auxiliary views.

To define such a view only one arrow is needed and getting rid of section line and marks is easy with these settings:
Snip macro screenshot-ec63b4.png
Snip macro screenshot-ec63b4.png (22.44 KiB) Viewed 1097 times
But I have no idea how to hide the second arrow.
Snip macro screenshot-45fca3.png
Snip macro screenshot-45fca3.png (73.41 KiB) Viewed 1097 times
I wanted to put an annotation on top to hide it but realised that its background colour is "transparent" and all others' drawing items, too

To get a true image of the slot I needed to extract the view direction and therefore had to create two auxiliary lines. Too bad that we can't use centrelines with angle dimensions.

View R itself looks like expected but it is impossible to use it as a base view for further views. Is it anyhow possible to derive its 3D direction vector? This could help to project the 3D origin to place a UV coordinate system and this in connection with some UV coordinates could enable "backwards" calculation to place geometry such as points and section planes in 3D space.

I had a look at the code to see if I could tweak and test if by myself but gave up. My level of C++ knowledge is far too low. :(
But I have a quite long whishlist and some ideas about the workflow if you are interested...
Post Reply