[Feature Request] Allow changing the position of the section plane before creating the preview

Discussions about the development of the TechDraw workbench
Post Reply
ToniTen
Posts: 174
Joined: Fri Sep 04, 2020 10:11 am

[Feature Request] Allow changing the position of the section plane before creating the preview

Post by ToniTen »

Right now, when you create a section view, you first select the main view that will serve as the base for the section view, and then click on the create section view icon. You get this dialog:
Screenshot_2022-01-13_11-44-03.png
Screenshot_2022-01-13_11-44-03.png (23.23 KiB) Viewed 1430 times
From there you select the section direction and it generates a preview. You then change the plane location, it generates a new preview, and then when you accept, it creates the real deal.

This is perfectly fine for simple models, but when the model complexity grows (and specially if you're using imported STEP files with less than good geometry in them), doing the preview takes a long time, and then if the section plane is not where you want it, you have to change it's location, wait for a new preview to be generated, and then wait again for the real section view to appear. You can't change the section plane location before you select the section direction.

Would it be possible to either have a "generate preview" checkbox that I would unmark to I only see the base view and the section line while deciding where to put the section, or to have the input fields for the section plane location enabled before selecting the section direction?

I had a real case of having to wait over 5 minutes for the preview to appear, while knowing that it was wrong since it was not going to be where I needed it.

FreeCAD version information

Code: Select all

OS: Ubuntu 18.04.6 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.27008 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 9162733)
Hash: 91627338a44371fe9a8e815b4900f62558af98a1
Python version: 3.9.9
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Spanish/Spain (es_ES)
User avatar
wandererfan
Veteran
Posts: 5285
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature Request] Allow changing the position of the section plane before creating the preview

Post by wandererfan »

ToniTen wrote: Thu Jan 13, 2022 11:00 am You can't change the section plane location before you select the section direction.
[/quote]
I don't have an old version installed, but it seems to me that this used to be allowed. Seems reasonable to me to set the SectionOrigin before generating the view.

issue #4828
bensay
Posts: 53
Joined: Wed Dec 22, 2021 8:14 pm
Location: Danmark

Re: [Feature Request] Allow changing the position of the section plane before creating the preview

Post by bensay »

So I was looking on this late yesterday: https://github.com/FreeCAD/FreeCAD/pull/5467.

I made it so the section view isn't drawn if automatically, but that values can be changed without triggering and update. There's just one problem: it only works for the section plane location settings (X Y Z). Not the section plane direction, that will still be updated everytime.

We would like that we can still see the section plane location without FreeCAD computing the view (it wouldn't make sense to change XYZ values if you couldn't see where the section plane is going anyway). But I couldn't figure out how to seperate these to functions. The closest I came was that both the section plane location and section view was created in the TaskSectionView::createSectionView(void) function.

Could anyone give a clue to where the section plane (dashed with arrows) and the section view itself is made, so I can split up the 2 functions? @wandererfan @kunda1

It's a bit hard to explain? But let me know if I need to clarify what I mean.
User avatar
wandererfan
Veteran
Posts: 5285
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature Request] Allow changing the position of the section plane before creating the preview

Post by wandererfan »

bensay wrote: Mon Jan 31, 2022 11:33 am Could anyone give a clue to where the section plane (dashed with arrows) and the section view itself is made, so I can split up the 2 functions? @wandererfan @kunda1
The section line is drawn on the base view here: void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b).

The section view is drawn by Gui/QGIViewSection.cpp based on changes in App/DrawViewSection.cpp. The slow processing is triggered by DrawViewSection's call to DrawViewPart::buildGeometryObject() which calls the OCC Hidden Line Removal algos.
Post Reply