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.
User avatar
uwestoehr
Posts: 2730
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Tue Jun 08, 2021 2:43 am

realthunder wrote: Mon Jun 07, 2021 11:28 pm but of course a native section feature will be more convenient.
Thanks. So I will update my PR to get it merged. Maybe I should give it a better name to make clear that its result is a real object, not something just for a view.
User avatar
M4x
Posts: 366
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: PR #4074 The section cut feature

Postby M4x » Tue Jun 08, 2021 3:35 am

Hm, interesting idea. Maybe something like permanent section cut?
galou_breizh
Posts: 362
Joined: Wed Sep 15, 2010 9:38 am

Re: PR #4074 The section cut feature

Postby galou_breizh » Wed Jun 09, 2021 7:38 pm

realthunder's branch includes a split function that does exactly that, a permanent cut. The cutting element does not even need to be planar. You can select to activate one side of the split or the other.
User avatar
M4x
Posts: 366
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: PR #4074 The section cut feature

Postby M4x » Wed Jun 09, 2021 8:58 pm

Are you talking about Part_SliceApart? ;)
User avatar
Pauvres_honteux
Posts: 498
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: PR #4074 The section cut feature

Postby Pauvres_honteux » Thu Jun 10, 2021 8:39 am

Thinking of the commercial software I use on a daily basis, they all have section cut/view that are blistering fast no matter how big of a model one load into memory (up to tens of gigabyte) and the section cut/view still performs in sub-seconds.
This leads me to belive they must utilize the graphic card capability in some way, not the CPU.
Further, they have obviously found a way to achive the section view + visible and selectable edges + filling and therefore measure possibilities, even cross section area calculation.

The question that comes to my mind: is COIN really not possible to trick into doing this type of visualisation?
Is it absolutely necessary to replace it with a new rendering engine? (I imagine it's not something you do in a coffe break)
Exactly what is missing in COIN to make it work?
And exactly what is gained (and do we loose something?) if we make the switch to the newer rendering engine?
werner wrote:
User avatar
uwestoehr
Posts: 2730
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: PR #4074 The section cut feature

Postby uwestoehr » Thu Jun 10, 2021 12:59 pm

M4x wrote: Wed Jun 09, 2021 8:58 pm Are you talking about Part_SliceApart? ;)
I don't see how I can this way cut assemblies. However my PR does in fact so the same
- first create a box
- take the assembly and cut the box from it

The general problem is hereby that the cut operation is quite slow for larger assemblies. But OK, the normal use case is probably to cut either just one object or simpler assemblies.

From my former work with SolidWorks I remember that also its section feature needed a lot of time to calculate a cut through assemblies with 10 and more parts.
chrisb
Posts: 35188
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #4074 The section cut feature

Postby chrisb » Thu Jun 10, 2021 2:05 pm

For a ping you need the user_id:
Werner wrote: ping
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
FLOSS Noobie
Posts: 12
Joined: Sat Feb 27, 2021 1:17 am

Re: PR #4074 The section cut feature

Postby FLOSS Noobie » Fri Jun 11, 2021 1:56 am

Pauvres_honteux wrote: Thu Jun 10, 2021 8:39 am The question that comes to my mind: is COIN really not possible to trick into doing this type of visualisation?
You can take a look at the Fosdem talk by Realthunder and OficineRobotica to get a little overview of the new renderer https://youtu.be/-K1EVcYAmRM?t=1493
I'm not a developer or anything like that, so take everything I say with a grain of salt ;) .
Essentially, this is what I can understand about the new renderer.
Coin 3d is quite outdated and its rendering part is now kind of obsolete, so instead of going with a completely new scene graph library, the plan is to upgrade only the rendering with Diligent Graphics. It sure isn't a small task, but it's a better option.
The new renderer would allow the implementation of new functionalities as well as a performance upgrade, which would allow FreeCAD to better handle large/complex models, see this thread https://forum.freecadweb.org/viewtopic.php?f=8&t=12134.
Also, people who have modern hardware would benefit from the new rendering engine, as Diligent Graphics focuses on taking full advantage of the modern graphics APIs (Vulkan and Direct3D12) while supporting older hardware through Direct3D11 and OpenGL.
Once again, don't take what I say too seriously. I mean, just look at my user name :D .
Hopefully it was helpful in some way.
galou_breizh
Posts: 362
Joined: Wed Sep 15, 2010 9:38 am

Re: PR #4074 The section cut feature

Postby galou_breizh » Tue Jun 15, 2021 12:14 pm

M4x wrote: Wed Jun 09, 2021 8:58 pm Are you talking about Part_SliceApart? ;)
No I'm talking about PartDesign/Split (only available in realthunder's fork I think).
realthunder
Posts: 1981
Joined: Tue Jan 03, 2017 10:55 am

Re: PR #4074 The section cut feature

Postby realthunder » Wed Jun 16, 2021 9:42 am

galou_breizh wrote: Tue Jun 15, 2021 12:14 pm
M4x wrote: Wed Jun 09, 2021 8:58 pm Are you talking about Part_SliceApart? ;)
No I'm talking about PartDesign/Split (only available in realthunder's fork I think).
They actually share the same code. So for anyone wandering the difference, just think about Part_SliceApart and Part_Section. They have some overlap, but not exactly the same.

Pauvres_honteux wrote: Thu Jun 10, 2021 8:39 am This leads me to belive they must utilize the graphic card capability in some way, not the CPU.
Further, they have obviously found a way to achive the section view + visible and selectable edges + filling and therefore measure possibilities, even cross section area calculation.
I am sure they are using rendering trick to achieve instant section. It can even do rough edge detection and area measurement. But I doubt the result is good enough for engineering use. The real geometrical section (which is supposed to give the analytical solution) won't be that fast.

The question that comes to my mind: is COIN really not possible to trick into doing this type of visualisation?
Is it absolutely necessary to replace it with a new rendering engine? (I imagine it's not something you do in a coffe break)
Exactly what is missing in COIN to make it work?
For relatively simple rendering task, like the section filling, it is possible without big change, but then that's not something readily available in Coin, so you'll have to render it with your own OpenGL calls anyway. And the aging rendering framework of Coin is actually making the task harder.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal