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: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

domad wrote: Fri Dec 23, 2022 1:57 pm ...in that case the direction arrows should appear orthogonal to the cut path...
No! The direction arrows must allways be perpendicular to the section line!

The section line represents rather a wall to look at than a path to follow.

wandererfan wrote: Fri Dec 23, 2022 3:33 pm Maybe this...
:lol:
wandererfan wrote: Fri Dec 23, 2022 3:33 pm We could put a test to block this kind of request. Maybe by making a plane from the profile, then testing if the plane's normal is parallel (ish?) to the view direction?
The plane containing the section line is the base view plane...

From my point of view both section tools are far more than just useable by now.
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: Complex Sections

Post by domad »

Greetings to the Community and a Merry Christmas!
There is no doubt that the "Complex Section" function works very well.
I have carried out several tests with surprising results that can give a lot of room for "creativity", therefore it would be a mistake (as well as a useless coding complication), contrary to what was suggested in the previous reply, to condition/block the function in some cases.
Attachments
Particular representation in section.FCStd
(131.35 KiB) Downloaded 41 times
Particular representation in section.png
Particular representation in section.png (151.49 KiB) Viewed 1532 times
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

Merry Christmas y'all!
domad wrote: Sat Dec 24, 2022 6:25 pm...
I'm sorry domad but you need an orthogonal sight on the plane holding the section line and therefore need an auxiliary view X where you can define the view direction rectangular to the section line ends leading to section Y-Y:
Snip macro screenshot-776343.png
Snip macro screenshot-776343.png (47.29 KiB) Viewed 1498 times
To achieve a section like B-B only one section line is needed and so a simple section would be adequate. The first and last segment of your polyline are projected as points in the base view and useless for B-B.

In fact I was surprised to be able to use AuxView X as a base view for another section. I could not create such a chain of views before and thought it impossible yet.

@wandererfan Is it true that TechDraw projects solids only and so Wire geometry can be added to the Source property but still will not be displayed in the view?
Edit: It seems like tools fail until I ask about restrictions and then, even without answers, the magic happens... :roll:
Now adding to the Source property is working - it was just some (not documented?) clicks away.
Last edited by FBXL5 on Mon Dec 26, 2022 7:36 am, edited 1 time in total.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Complex Sections

Post by aapo »

domad wrote: Sat Dec 24, 2022 6:25 pm There is no doubt that the "Complex Section" function works very well.
I have carried out several tests with surprising results that can give a lot of room for "creativity", therefore it would be a mistake (as well as a useless coding complication), contrary to what was suggested in the previous reply, to condition/block the function in some cases.
I completely agree with that. Artificially limiting away some "wrong" or "non-standard" ways to use the new tool gains nothing, and only raises a barrier for those who want to experiment with some novel ways to construct Section drawings. Of course, I feel it's important to make sure that it's easy to use the new tool to make standard-compliant drawings, but I think (as others have pointed out) that this is already the case.

I sure like how it's already currently very possible to bend the rules with the Complex Section tool (if one so desires)! :D
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: Complex Sections

Post by domad »

aapo wrote: Sun Dec 25, 2022 6:48 pm ....
Hi aapo, greetings to the Community!

You have fully captured the meaning of my previous replies, erroneously understood as my difficulties in creating sectioning.
Unfortunately, the choice of the red color for the rectangular compartments, visible in the images of the previous replicas, was not meant to be an error signal from the "Complex section" function, but rather to indicate that the two semi-sections, apparently obtained separately, they were actually obtained with a single cutting operation in TechDraw.
Given the particular trend and positioning of the section path and the "surprising" results shown by the "Complex section" function in the TechDraw view when the sectioning type changes: Offset-Aligned and NoParallel, they had left me "perplexed".
In order to eliminate my "perplexities", respecting angles, paths and planes, I "simulated" the sectioning, performed by the code of the "Complex section" function, directly on the model: the result obtained was exactly the same, therefore the code that manages the "Complex section" function, created by @wandererfan, works absolutely correctly, as shown in the attached image (note: the red color of the compartmentalization does not indicate an error).
Therefore conditioning/blocking the function in some cases (even out of the norm) I confirm (!), would be a mistake as it would limit creativity.
I don't know if such a flexible and advanced function as the one TechDraw has today is present in other commercial and non-commercial cad software(!), many thanks to @wandererfan for lightening my work for the creation of particular sections and for making it possible /simple at all. :D
Attachments
Particular representation in section_Model3D.png
Particular representation in section_Model3D.png (205.23 KiB) Viewed 1368 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

FBXL5 wrote: Fri Dec 23, 2022 11:56 am A minor issue occurs when you set the view angle with the rotation buttons:
...
The rotation buttons do not trigger the live update.
There is a problem with having each press of the rotation button trigger the update. If you push the button fast enough, the update triggers a bunch of threads that eventually get out of sync and cause a segfault. I haven't figured out how to prevent this yet, so I'm going to leave the requirement to press enter before updating in place for now. Consider it the TechDraw version of the QWERTY keyboard.

We'll leave the edit to prevent "impossible" sections out for now, If it becomes a problem, I'll make a preference switch for "Allow impossible ComplexSection".
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

@wandererfan While trying out how to read out the content of a selection I stumbled upon something puzzling in connection with complex sections:

I wanted to count several types of views in my selection:

Code: Select all

nb_primary_views = Gui.Selection.countObjectsOfType('TechDraw::DrawProjGroupItem')
print("Number of primary views: ", nb_primary_views)

nb_section_views = Gui.Selection.countObjectsOfType('TechDraw::DrawViewSection')
print("Number of section views: ", nb_section_views)
nb_section_views = Gui.Selection.countObjectsOfType('TechDraw::DrawComplexSection')
print("Number of complex sections: ", nb_section_views)
As we can see 1 primary view, 2 section views and 3 complex section views are selected:
Snip macro screenshot-1e76ae.png
Snip macro screenshot-1e76ae.png (62.48 KiB) Viewed 1089 times
And the output is:

Code: Select all

09:39:59  Number of primary views:  1
09:39:59  Number of section views:  5
09:39:59  Number of complex sections:  3
The number of section views is in fact the number of section views + the number of complex sections.

Now I wonder if this is a bug or an intended feature.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

FBXL5 wrote: Fri Feb 03, 2023 9:10 am While trying out how to read out the content of a selection I stumbled upon something puzzling in connection with complex sections:
,,,
Now I wonder if this is a bug or an intended feature.
Internally, "countObjectsOfType" uses "isDerivedFrom", so, since DrawComplexSection is derived from DrawViewSection, DCS will be included in a count of DVS.

If you were to count objects of type "DrawView" you would get 6, since every view is derived from "DrawView"

The ancestry of DCS is:
DrawView > DrawViewPart > DrawViewSection > DrawComplexSection

For DrawViewDetail it would be:
DrawView > DrawViewPart > DrawViewDetail
User avatar
FBXL5
Posts: 980
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

wandererfan wrote: Fri Feb 03, 2023 2:08 pm Internally, "countObjectsOfType" uses "isDerivedFrom", so, since DrawComplexSection is derived from DrawViewSection, DCS will be included in a count of DVS.
Thanks. Then I have to keep that in mind and use bit more math to get the wanted results
Post Reply