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 »

I'm still puzzled why I would need splines to connect parallel planes (displayed as lines).

I used a lot offset sections, but never with splines between them.

Usualy I drew a line and when another parallel line was drawn the perpendicular connection line was created automatically. That gave some kind of polyline, like stairs if you keep the offset direction.

A section line then consists of an odd number of segments. The first defining the direction and the 3rd, 5th, ..., and last being parallel, while the even numbered segments being perpendicular to the first.

To derive the section view only the odd numbered segments are needed. Maybe it is possible to extract it like an aligned view, cut away the even numbered segments, and finally stitch the remaining segments together.
A line where segments are stitched displayed in the section view is absolutely tolerable and offset hatches as well.

If the aligned section view is possible this should function as well, or am I wrong?
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Complex Sections

Post by aapo »

FBXL5 wrote: Fri Sep 23, 2022 1:40 pm I'm still puzzled why I would need splines to connect parallel planes (displayed as lines).

I used a lot offset sections, but never with splines between them.
There's no reason, except to just stress-test the algorithm. Although I'm sure that someone someday is going to need that spline-section for some weird reason. :lol:

Usualy I drew a line and when another parallel line was drawn the perpendicular connection line was created automatically. That gave some kind of polyline, like stairs if you keep the offset direction.

A section line then consists of an odd number of segments. The first defining the direction and the 3rd, 5th, ..., and last being parallel, while the even numbered segments being perpendicular to the first.
This staircase-cut is indeed the standard, and it should work nicely with the current code already, if you choose the section direction correctly. As far as I understand, there's no need for aligned section code for this. You'll get some extra lines in the section (the edges of perpendicular cuts), but these can be removed by making these lines manually invisible. You'll probably also need to do the hatching manually, unless there is going to be code to automate the described procedure. In any case, it should be possible to do manually.
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

aapo wrote: Fri Sep 23, 2022 2:00 pm You'll get some extra lines in the section (the edges of perpendicular cuts), but these can be removed by making these lines manually invisible. You'll probably also need to do the hatching manually, unless there is going to be code to automate the described procedure.
I would'n remove the extra lines or fix the hatching. I like to see these hints of an offset cut in the section view. 8-)
aapo wrote: Fri Sep 23, 2022 2:00 pm In any case, it should be possible to do manually.
That's good news! Im looking forward to the implementation
aapo wrote: Fri Sep 23, 2022 2:00 pm Although I'm sure that someone someday is going to need that spline-section for some weird reason.
I could imagine that unfolded spline-sections might be helpful in relation with weird kinematic analyses. :ugeek: :lol:
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Complex Sections

Post by aapo »

Hi, I noticed that today's version almost works with aligned sections, too. The hatching is in wrong place, and the aligned diameter is almost there, but not quite correct. It's close, though, and apparently you decided to include the aligned mode. Thanks for developing that! :D

Test file included is for a very simple, but common basic case. The sketches are not constrained, which should make it easier to compare decimal values for accuracy.

20220924 TD ComplexSection test_p04.png
20220924 TD ComplexSection test_p04.png (92.29 KiB) Viewed 1639 times

Code: Select all

OS: Debian GNU/Linux bookworm/sid (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.30420 +4 (Git)
Build type: Release
Branch: (HEAD detached at WandererFan/ComplexSection)
Hash: 0f90d099a51d0586af5790bf4636578a6e246d4e
Python 3.10.7, Qt 5.15.4, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4
  * Render
  * fasteners
  * FCGear
  * Manipulator
  * Curves
  * sheetmetal
Attachments
20220924 TD ComplexSection test v3.FCStd
(44 KiB) Downloaded 34 times
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

aapo wrote: Sat Sep 24, 2022 11:18 am It's close, though, and apparently you decided to include the aligned mode.
Still working on the aligned mode. I have the right pieces of the original shape, but I'm having trouble getting the n "subviews" lined up.
domad
Veteran
Posts: 2051
Joined: Mon Jun 22, 2020 12:16 pm

Re: Complex Sections

Post by domad »

Greetings to the Community!
To determine the correct section aligned or placed on different planes, the role played, graphically, by the indication of the two arrows in terms of direction and by the changes of direction of the cutting line is fundamental, the following images clarify the concept mentioned above and of the because in some cases it is necessary to rotate the section face to obtain the aligned section.
To date, unfortunately, in TechDraw it is possible to obtain, automatically, only section views whose cutting line does not change direction and, through the relative parameters, to transform it (translation and / or rotation).
But thanks to the great work of @wandererfan the section on different levels is moving towards a next solution.
Meanwhile, to get around this limitation FreeCad provides us with the multitude of tools present in the various workbenches.
In this regard, the attached file contains, in addition to the Pages referred to in the images, also an example of "dynamic automatism", created for convenience, for the creation, dynamic in real-time, of many section faces (Facebinder) then converted into sketch and used (even not converted) in TechDraw views.
The same automatism was used to create appropriate cuts in the object, which were used as section views in TechDraw.
The animated gif clarifies the concept.
To be able to use this "dynamic automatism" it is necessary to install the "DynamicData" wb.
Attachments
angledSection_domad.FCStd
(190.33 KiB) Downloaded 31 times
Functional_example_of_determining_aligned_sections-1.png
Functional_example_of_determining_aligned_sections-1.png (191.3 KiB) Viewed 1565 times
Functional_example_of_determining_aligned_sections-2.png
Functional_example_of_determining_aligned_sections-2.png (169.03 KiB) Viewed 1565 times
Dynamic_section_creator.gif
Dynamic_section_creator.gif (305.58 KiB) Viewed 1565 times
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Complex Sections

Post by wandererfan »

Complex section results for Section Normals and profiles parallel to the XY plane seem right to me (profile segments parallel to Section Normal as in @domad's DD and EE haven't been tried yet). Next step is to see if it works from other orientations and to try parallel profile segments. The is also an issue with hatching when the profile is a curve instead of line segments.

I have some questions for the experts:
- can the segments of the profile that are parallel to the SectionNormal/ViewDirection just be ignored, or is some sort of indication needed on the section view or the base view?
- should the arrows on the section line in the base view be aligned with the SectionNormal (the view direction) or should they be perpendicular to the first and last segment?
- is there a requirement for a dividing line between the pieces of the view or is this inferred from the section line in the base view?

complexSection_2segmentSN110.png
complexSection_2segmentSN110.png (44.36 KiB) Viewed 1424 times
complexSection_MultiSegSinglevsPieceWise.png
complexSection_MultiSegSinglevsPieceWise.png (54.96 KiB) Viewed 1424 times
User avatar
FBXL5
Posts: 979
Joined: Sat Aug 03, 2019 8:45 pm

Re: Complex Sections

Post by FBXL5 »

wandererfan wrote: Wed Sep 28, 2022 8:09 pm can the segments of the profile that are parallel to the SectionNormal/ViewDirection just be ignored, or is some sort of indication needed on the section view or the base view?
The parallel segments can be ignored, they would projekt as a line in the section view. These lines give a clean border between two hatched areas and a hint where the displayed level changes.
Angles between section line segments and the arrow bases are marked with short lines that are twice the width of the sectionline.
wandererfan wrote: Wed Sep 28, 2022 8:09 pm should the arrows on the section line in the base view be aligned with the SectionNormal (the view direction) or should they be perpendicular to the first and last segment?
The arrows must fulfil both requirements. They define the view direction = section normal and must be rectangular to the (first and last) section line. And so the arrows have to be parallel except for aligned section views.
wandererfan wrote: Wed Sep 28, 2022 8:09 pm is there a requirement for a dividing line between the pieces of the view or is this inferred from the section line in the base view?
I'd say they are inferred from the segment parallel to the view direction. The only requirement that comes to my mind is, that their width is half the width of visible edges and outlines.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Complex Sections

Post by aapo »

wandererfan wrote: Wed Sep 28, 2022 8:09 pm Complex section results for Section Normals and profiles parallel to the XY plane seem right to me (profile segments parallel to Section Normal as in @domad's DD and EE haven't been tried yet). Next step is to see if it works from other orientations and to try parallel profile segments. The is also an issue with hatching when the profile is a curve instead of line segments.
Great job! :D I'll try to find some time in the evening to test this functionality, and replicate Domad's sections with the newest codebase. Do you think it would be straightforward to add an option for those small thick lines at the end of the section line segments as in Domad's pictures? I believe they are normally required in proper technical drawings. They are basically thickened line endings of the segments, and they are always parallel to the segment lines themselves. So, it could be a new Section View Property: "Section line segment endings" true or false.

Section-line-endings.png
Section-line-endings.png (23.18 KiB) Viewed 1334 times
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Complex Sections

Post by aapo »

FBXL5 wrote: Wed Sep 28, 2022 10:38 pm The parallel segments can be ignored, they would projekt as a line in the section view. These lines give a clean border between two hatched areas and a hint where the displayed level changes.
Angles between section line segments and the arrow bases are marked with short lines that are twice the width of the sectionline.
I agree, that seems like the right course of action.

The arrows must fulfil both requirements. They define the view direction = section normal and must be rectangular to the (first and last) section line. And so the arrows have to be parallel except for aligned section views.
Yes, I agree with that, too. So, programatically:
  • Single projection mode: Both arrows are always parallel to SectionNormal (the view direction)
  • Aligned section aka piecewise mode: The arrows are parallel to SectionNormals they touch, i.e. the first and last segment view directions.
Note that the previous rules do not make the arrows always perpendicular to the line segments they touch. See, for example, Domad's section A-A, which also adds an extra line ending at the end of the section line (to which the arrow is perpendicular to). I'm not sure if this special case should be fully supported or not. The piecewise mode with more than two segments (i.e. extension of normal aligned section) is likely non-standard anyway, so I'd just make the first and last segments with arrows there, and let the user worry about whether or not to add extra direction arrows manually in the middle segment(s).

I'd say they are inferred from the segment parallel to the view direction. The only requirement that comes to my mind is, that their width is half the width of visible edges and outlines.
Agreed.
Post Reply