[Temporarly Solved] Design456 will die if I don't get some help

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

[Temporarly Solved] Design456 will die if I don't get some help

Post by mariwan »

Hi,
I am quite sure that there is a serious problem with the engine and the core of FreeCAD which make my Workbench development impossible.
"Recreating objects" is the base of the project. Not been able to do that in a responsive way, specially for so small amount of faces (which were 6 only), means that there is no solution for my WB with OCCT.

Now, Coin3D is not the answer. I don't think Coin provide better/easy way of drawing objects. I tried too hard to use it and I don't like it at all.
Now, I am not aware of any other CAD engine that is available ( I am not so deep in the question), but you might know and you (might) tried different things.
Please let me know if there are any other possibilities out there. Don't know which library would make sense to use.
I am really wishing to get a way to continue. I love so much the project that I cannot imagine it is the end..
the end is painful.
Hope for some help.
Best Regards,
Mariwan
Last edited by mariwan on Sun Nov 28, 2021 1:27 pm, edited 1 time in total.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Design456 will die if I don't get some help

Post by adrianinsaval »

I noticed the other you set a tolerance value in your code, does increasing the tolerance help? You could try doing something with openscad, not sure if that would be faster.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Design456 will die if I don't get some help

Post by carlopav »

The approach you are using is not sustainable with FreeCAD. You cannot recompute the document every time the mouse moves, that's just crazy!
I suggest you to try to recompute just the shape, do not add it to the object but only display it in coin. If it's not fast enough, just recompute the edges and display them in coin. Apply the shape to the object and recompute only at the end of the action.
Eventually you could have a look at how PartDesign preview works in master branch or in RT fork.
follow my experiments on BIM modelling for architecture design
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Design456 will die if I don't get some help

Post by mariwan »

adrianinsaval wrote: Fri Nov 26, 2021 12:13 pm I noticed the other you set a tolerance value in your code, does increasing the tolerance help? You could try doing something with openscad, not sure if that would be faster.
The tolerance is for the end. It is not used yet. The only thing I do is to recreate the faces with new vertexes I get from moving the edge.
That part is to fix problem with the solid version of the faces.
thanks anyway
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Design456 will die if I don't get some help

Post by mariwan »

carlopav wrote: Fri Nov 26, 2021 1:11 pm The approach you are using is not sustainable with FreeCAD. You cannot recompute the document every time the mouse moves, that's just crazy!
I suggest you to try to recompute just the shape, do not add it to the object but only display it in coin. If it's not fast enough, just recompute the edges and display them in coin. Apply the shape to the object and recompute only at the end of the action.
Eventually you could have a look at how PartDesign preview works in master branch or in RT fork.
Carlopav,
The problem with Coin: It is not so easy either. The code will be huge and terrible for nothing.
Recomputing only the edge, will not give the normal feeling of Direct Modeling.
If I cannot recompute the document, which I don't do - I removed them all, it is done automatically, then there is no direct modeling. You need to modify objects and get the feeling that you are modifying them on-fly .. not after you release the mouse.
Thanks anyway.
As other mentioned, Part.makeFilledFace is causing the issue .. Which is OCCT+FreeCAD code.
BR
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Design456 will die if I don't get some help

Post by carlopav »

did you try to stop before face reconstruction and get the visual through:

Code: Select all

Shape.writeInventor()
?
follow my experiments on BIM modelling for architecture design
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Design456 will die if I don't get some help

Post by mariwan »

carlopav wrote: Fri Nov 26, 2021 4:29 pm did you try to stop before face reconstruction and get the visual through:

Code: Select all

Shape.writeInventor()
?
Didn't help
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Design456 will die if I don't get some help

Post by kwahoo »

mariwan wrote: Thu Nov 25, 2021 8:13 pm Now, I am not aware of any other CAD engine that is available ( I am not so deep in the question), but you might know and you (might) tried different things.
Maybe creating a hybrid CAD using two CAD kernels, one fast (Mesh - based) and second precise (B-Rep - based) could solve this?
How I see this:
1. Two CAD kernels work asynchronously, the fast one is used for interaction with user, previews etc.
2. The precise one is independent from user interactions, and can recompute at much lower rate. In the worst case, only for file save/export.
3. Both kernels use the same user input as data. If a shape is not available in the fast one API, then precise one creates it and converts to mesh as fast one input data.

The precise kernel would be OpenCASCADE.
The fast one, maybe ImplicitCAD? I'm not sure how flexible it is, but it seems to be fast at least.
From FAQ:
ImplicitCAD has a perfect internal model of your object. It is of near-infinite resolution. In order to access it, it is rendered into an approximating triangle mesh, a raytraced image or GCode. These approximations can be of varying quality, depending on what you request.

Is ImplicitCAD Faster than OpenSCAD?
It depends. In most cases, probably.

The speed of ImplicitCAD depends on quality of the rendering you are trying to make. To make models of comparable quality to their OpenSCAD counter parts, ImplicitCAD is generally much faster.

OpenSCAD's performance drastically slows down as objects get more complex. ImplicitCAD's performance is much less affected by the complexity of the objects it is rendering (more affected by the quality of object you ask it to render). ImplicitCAD also often has simpler ways of representing objects than OpenSCAD.

ImplicitCAD is capable of parallel rendering. Unlike OpenSCAD, it is happy to use more threads and be faster!
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Design456 will die if I don't get some help

Post by mariwan »

kwahoo wrote: Fri Nov 26, 2021 7:35 pm Maybe creating a hybrid CAD using two CAD kernels, one fast (Mesh - based) and second precise (B-Rep - based) could solve this?
How I see this:
1. Two CAD kernels work asynchronously, the fast one is used for interaction with user, previews etc.
2. The precise one is independent from user interactions, and can recompute at much lower rate. In the worst case, only for file save/export.
3. Both kernels use the same user input as data. If a shape is not available in the fast one API, then precise one creates it and converts to mesh as fast one input data.

The precise kernel would be OpenCASCADE.
The fast one, maybe ImplicitCAD? I'm not sure how flexible it is, but it seems to be fast at least.
From FAQ:...
Thank you very much for your suggestion.
This might be a solution.
I must:
-Know how to install it - User install it
-Use it in the current problematic tool.
-If I success in that, Any tool needs more speed should use this library. Or I make it more general and use it everywhere? don't know now.
I work on that directly. Thanks again.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Design456 will die if I don't get some help

Post by mariwan »

Oh!!

Code: Select all

Windows / Mac Packages

Sadly, ImplicitCAD packages have not been made for these operating systems yet. 
Post Reply