Python profiling - Chrom Tracing

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!
nic
Posts: 135
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Python profiling - Chrom Tracing

Post by nic »

Maybe recreateObject is called 100,000x ? , therefore a hope for scaling down elapsed time?
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Python profiling - Chrom Tracing

Post by mariwan »

nic wrote: Thu Nov 25, 2021 8:25 pm Maybe recreateObject is called 100,000x ? , therefore a hope for scaling down elapsed time?
If the change is >1mm .. it will recreate the faces otherwise it just return. So even if it is called, not sure that it needs to do anything.
I cannot avoid running when the change of the length of any edge is more than 1 .. because that is the tool. Change size of the object by dragging the edge.
And 1mm is reasonable.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Python profiling - Chrom Tracing

Post by adrianinsaval »

mariwan wrote: Thu Nov 25, 2021 8:31 pm If the change is >1mm .. it will recreate the faces otherwise it just return. So even if it is called, not sure that it needs to do anything.
I cannot avoid running when the change of the length of any edge is more than 1 .. because that is the tool. Change size of the object by dragging the edge.
And 1mm is reasonable.
Not saying this would solve the problem but it might not actually be reasonable, what if you're modelling something that's 10m? A value relative to the object bounding box would probably make more sense. There could also be a problem with how the change is calculated? Either way, OCCT is not a very fast geometric kernel so it might just not be possible. Another thing, are you recreating all the faces of the object? isn't it possible to keep the faces that are not changed and only recreate the ones affected by moving the edge? (in the case of a cube this would be just 2 faces so the speed up would probably not be more than 33%.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Python profiling - Chrom Tracing

Post by mariwan »

I understand,
This might be an option in the code .. but the actual problem is the slowness of the operation regardless this tool.
There are many other tool in my plan which are also based on recreating the whole object or faces. Like removing hole, copy hole ..etc
You must recreate the object faces by faces otherwise there is no way to do it.

But isn't strange that OCCT fails in creating faces in a reasonable time? It is not Fuse, cut or anything like that .. it is just creating a face ..
I tried to use Part.Face .. but occt failing with no reason.
Post Reply