PR #4074 The section cut feature

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
carlopav
Posts: 1661
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: PR #4074 The section cut feature

Postby carlopav » Sun Dec 13, 2020 1:24 pm

I want to express my appreciation for the effort in developing such feature, it is really needed in the architecture workflow too. And I think that the tool would be really powerful if it could combine
M4x wrote:
Tue Nov 24, 2020 11:15 am
Volumetric rendering and boolean cut

BTW: Did you check yorik Arch_SectionPlane object? It can cut the model at arbitrary angles, it display the clipping plane to the user and, through Draft_Shape2DView it can display the cut faces just in place ( if In Place is true, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear co-planar with the Arch SectionPlane).
yorik wrote: ping
in Arch_SectionPlane the CutView property makes a trick to display the section in black without performing boolean operations: the Lighting ViewObject property is turned to "One Side" so the back faces are not lit and they melt with the object's black edges. Of course some sort of coin trick to have a "volumetric rendering" would be much more effective, but that's already a nice option.

I did some experiments to improve it and make it also able to host annotation objects, but it's just a weekend experiment at the moment. (what is nice IMO is that you can move the section plane with the transform tool)

good luck!

EDIT: Adding a gif to display the workflow in Arch:

Zd1x1o7wD9.gif
Zd1x1o7wD9.gif (275.75 KiB) Viewed 528 times
follow my experiments on BIM modelling for architecture design
User avatar
uwestoehr
Posts: 2675
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Sun Dec 13, 2020 3:06 pm

carlopav wrote:
Sun Dec 13, 2020 1:24 pm
BTW: Did you check yorik Arch_SectionPlane object?
I had a look at this before I started. The point is that I need a cut view for assemblies. Moreover I need the cut result as editable object.
But even when putting the demand for an editable result aside, the Arch feature doesn't solve the main issue: the cuts are hollow.

Here is my example assembly cut by Arch:
FreeCAD_fJt64IMFMA.png
FreeCAD_fJt64IMFMA.png (48.36 KiB) Viewed 521 times

So you cannot see much and even things that are not in the section plane (like the screw that is far behind the plane).

EDIT: Adding a gif to display the workflow in Arch:
That looks good. Will this be able to cut also assemblies of parts?
carlopav
Posts: 1661
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: PR #4074 The section cut feature

Postby carlopav » Sun Dec 13, 2020 7:09 pm

uwestoehr wrote:
Sun Dec 13, 2020 3:06 pm
That looks good. Will this be able to cut also assemblies of parts?
Seems so:
Cattura.PNG
Cattura.PNG (49.23 KiB) Viewed 486 times

Combining in this way the clipping view with the boolean cut should be faster because the output of the boolean operation is not the full assembly but just the faces that lie on the section plane. But I did never benchmarcked this assumption. To me it would be cool if the section plane object once activated could embed the section cut.
In the Architectural workflow it's quite usual to work using Section Planes, so I'm really interested in some possible ways to have some kind of volumetric rendering while editing and some kind of boolean section cut while exporting to techdraw. I made some attempts to dig more into that in the past, but I'm a complete python beginner and I hardly can read c++... Hope this can be useful to you at least :)
follow my experiments on BIM modelling for architecture design
User avatar
uwestoehr
Posts: 2675
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Sun Dec 13, 2020 8:31 pm

carlopav wrote:
Sun Dec 13, 2020 7:09 pm
Combining in this way the clipping view with the boolean cut should be faster because the output of the boolean operation is not the full assembly but just the faces that lie on the section plane.
Then I did not understand correctly how this works. What I simply need is a cut view like in SolidWorks and friends. So something like this:
Image
just in CAD ;) .
So the remain is a real body to which I can set a color to the different cut areas and I can modify the result like any normal part.

(As I wrote in my initial post, I had to present my work in a meeting and people there did not understand what I designed why. They wanted to see details and discuss them. In the past I already used boolean cuts for this, but doing this manually takes too long for a presentation.)

For technical drawing, the existing TechDraw section view works nicely, at least for assembly 4 assemblies. To get the outlines if the section, I can also use Part's section tool. But with the Arch Section plane as it is, I get hollow structures like when I use the Std_Clipping feature.

So I think to understand you proposed feature, I need to test it out. How can I do this?
carlopav
Posts: 1661
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: PR #4074 The section cut feature

Postby carlopav » Sun Dec 13, 2020 8:53 pm

uwestoehr wrote:
Sun Dec 13, 2020 8:31 pm
Then I did not understand correctly how this works. What I simply need is a cut view like in SolidWorks and friends. So something like this:
just in CAD ;) .
I think you can't obtain it at the moment with Arch SectionPlane cause the tool clip the entire view... (It is a mixture of cutted solids and non cutted solids, and the section plane is bent 90°), sorry for making all this noise, it was not my intention. :?
So I think to understand you proposed feature, I need to test it out. How can I do this?
I made a quick gif to show you the workflow so you can try it and figure out if it's something that can help you :)
cutfaces.gif
cutfaces.gif (970.35 KiB) Viewed 455 times
and of course you can change the color of the Shape2dView object...
follow my experiments on BIM modelling for architecture design
User avatar
uwestoehr
Posts: 2675
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Mon Dec 14, 2020 1:17 am

carlopav wrote:
Sun Dec 13, 2020 8:53 pm
I think you can't obtain it at the moment with Arch SectionPlane cause the tool clip the entire view... (It is a mixture of cutted solids and non cutted solids, and the section plane is bent 90°), sorry for making all this noise, it was not my intention. :?
OK.
I made a quick gif to show you the workflow so you can try it and figure out if it's something that can help you :)
and of course you can change the color of the Shape2dView object...
Thanks! However, the result is still a 1 mm thick hollow structure above the section plane:
FreeCAD_FiTggXk0tW.png
1 mm hollow structure
FreeCAD_FiTggXk0tW.png (105 KiB) Viewed 421 times
If I would be able to get rid of this structure, the result would be fine for some uses cases.

I can also not set the colors to the different faces for the Shape2dView object. When I use the context menu to set colors, nothing happens.

-------------------------------

Back to the cut feature. I used it a lot the last week and it does the job for me. However, the face coloring is strange because when you change the cut position in steps of 0.5 mm you get every time different face colors and even transparent faces, here an example:
FreeCAD_OODl6HLFzR.png
random colored faces just by cutting
FreeCAD_OODl6HLFzR.png (29.97 KiB) Viewed 421 times

The only way it work for me is to remove all colors and transparencies and after the cutting to set the face color:
FreeCAD_yo657Qh1Is.png
working
FreeCAD_yo657Qh1Is.png (33.17 KiB) Viewed 421 times
User avatar
uwestoehr
Posts: 2675
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Mon Dec 14, 2020 1:32 am

uwestoehr wrote:
Mon Dec 14, 2020 1:17 am
Thanks! However, the result is still a 1 mm thick hollow structure above the section plane:
If I would be able to get rid of this structure, the result would be fine for some uses cases.
Ah, I only have to set the "Cut Margin" of the Arch Section to 0 mm. But then I still get a hollow structure, depending on the angle and zoom level. For example the same view angle but slightly different zooms:
FreeCAD_MA4Dp5IDCB.png
FreeCAD_MA4Dp5IDCB.png (30.52 KiB) Viewed 417 times
FreeCAD_Aa6I62RWpM.png
FreeCAD_Aa6I62RWpM.png (20.56 KiB) Viewed 417 times

So the trick Arch section makes with the illumination is nothing that really helps.
User avatar
Zolko
Posts: 1331
Joined: Mon Dec 17, 2018 10:02 am

Re: PR #4074 The section cut feature

Postby Zolko » Mon Dec 14, 2020 8:26 pm

This assembly-cut thingy is really great, thank-you. Where can it be tested ?

uwestoehr wrote:
Tue Nov 24, 2020 11:01 pm
add a radius measurement to Part's measure toolbar etc.
I guess you did see the Asm4 measurement tool ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
uwestoehr
Posts: 2675
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Tue Dec 15, 2020 1:57 am

Zolko wrote:
Mon Dec 14, 2020 8:26 pm
This assembly-cut thingy is really great, thank-you. Where can it be tested ?
Check out my PR: https://github.com/FreeCAD/FreeCAD/pull/4118

I guess you did see the Asm4 measurement tool ?
Not yet, thanks for the pointer. At the moment I use the manipulator Workbench to measure radiuses.
User avatar
M4x
Posts: 341
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: PR #4074 The section cut feature

Postby M4x » Sun Apr 04, 2021 1:45 pm

Does more work has to go into this or is this already something that could be merged during the 0.20 dev cycle?