[FIXED] Allowed section area smaller than Body size

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

[FIXED] Allowed section area smaller than Body size

Post by aapo »

Hi!

I noticed a small problem with TechDraw sections. It's a bit difficult to explain, so I made video about the problem. Basically the section view cannot extend beyond the body's original bounding box, and if you rotate the body, the bounding box is not rotated, which generally gives you too tight limits for the section line positions. Sorry about the bad quality in the video, but the forum won't allow files over 1 MB.

The following error is displayed, even though the section definitely intersects the part:

Code: Select all

DVS: SectionOrigin doesn't intersect part in DrawViewSection
DVS: Using center of bounding box.

EDIT: I forgot to attach the FCStd file, but it should be attached now. In the file, there is a section, which has origin (5,5,10). If you'll try to increase the z-value to 11, it jumps to 5 (the center of the original bounding box), even though there would clearly be room to increase the z-coordinate of the origin to 14.1... Anything bigger than 10, which is the z-coordinate of the original bounding box, resets the value to the center.

20191107-FreeCAD-TechDraw-section.gif
20191107-FreeCAD-TechDraw-section.gif (696.42 KiB) Viewed 630 times

OS: Debian GNU/Linux bullseye/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18696 (Git)
Build type: Unknown
Branch: master
Hash: dd120ef5075353580090dd385c235b4c74433745
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
20191107_FreeCAD_TechDraw_section.FCStd
(22.62 KiB) Downloaded 24 times
Last edited by aapo on Wed Nov 27, 2019 10:11 pm, edited 1 time in total.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Bug?] Allowed section area smaller than Body size

Post by wandererfan »

aapo wrote: Thu Nov 07, 2019 5:32 pm I noticed a small problem with TechDraw sections. It's a bit difficult to explain, so I made video about the problem. Basically the section view cannot extend beyond the body's original bounding box, and if you rotate the body, the bounding box is not rotated, which generally gives you too tight limits for the section line positions.
I think this is due to the Base view being in a ProjectionGroup. The RotationVector isn't handle properly in Section. Regular views don't have a RotationVector. If I position a regular View in the same way with Placement, the section looks right.
aapoSectionFromDPG.png
aapoSectionFromDPG.png (215.7 KiB) Viewed 568 times

The following error is displayed, even though the section definitely intersects the part:

Code: Select all

DVS: SectionOrigin doesn't intersect part in DrawViewSection
DVS: Using center of bounding box.
I'm going to remove the second half of that warning and the code that changes the SectionOrigin. If the user wants a SectionPlane that doesn't cut anything, so be it. I'll leave in the part that points out the lack of intersection.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: [Bug?] Allowed section area smaller than Body size

Post by aapo »

wandererfan wrote: Fri Nov 08, 2019 5:43 pm I'm going to remove the second half of that warning and the code that changes the SectionOrigin. If the user wants a SectionPlane that doesn't cut anything, so be it. I'll leave in the part that points out the lack of intersection.
That's a good plan, I think. However, I wonder if it could be possible to reset the SectionOrigin in the case, where there are no edges/faces found at all after the algorithm has run? I mean an empty set of edges in the section view would be quite a certain sign that the SectionOrigin is at a place where it should not be.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: [Bug?] Allowed section area smaller than Body size

Post by aapo »

Now it works with the current master, which has your latest pull request applied, thanks!

20191128_FreeCAD_TechDraw_section_fixed.png
20191128_FreeCAD_TechDraw_section_fixed.png (13.7 KiB) Viewed 485 times

OS: Debian GNU/Linux bullseye/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18801 (Git)
Build type: Unknown
Branch: master
Hash: 2efd9a133ec69be63aa45f6d87e7e1c3ec04cd64
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Post Reply