[Bug?] Allowed section area smaller than Body size

Discussions about the development of the TechDraw workbench
aapo
Posts: 87
Joined: Mon Oct 29, 2018 6:41 pm

[Bug?] Allowed section area smaller than Body size

Postby aapo » Thu Nov 07, 2019 5:32 pm

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 120 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 3 times
wandererfan
Posts: 3062
Joined: Tue Nov 06, 2012 5:42 pm

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

Postby wandererfan » Fri Nov 08, 2019 5:43 pm

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 58 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: 87
Joined: Mon Oct 29, 2018 6:41 pm

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

Postby aapo » Fri Nov 08, 2019 11:29 pm

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.