Part.__fromPythonOCC__ issue : Segmentation fault

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
User avatar
Cyril
Posts: 57
Joined: Wed Aug 23, 2017 5:04 pm
Location: Geneva (Switzerland)
Contact:

Re: Part.__fromPythonOCC__ issue : Segmentation fault

Postby Cyril » Thu Aug 01, 2019 9:57 pm

bernd wrote:
Thu Aug 01, 2019 8:22 pm
https://github.com/FreeCAD/FreeCAD/blob ... FC.py#L551

Code: Select all

shape.scale(1000.0) # IfcOpenShell always outputs in meters, we convert to mm, the freecad internal unit
might be simpler than the matrix one ...
Yes, it looks like result is the same. Thanks !

I struggle with documentation but I suppose scale use this method which use this OCCT method.

And it is more than 10 times faster :lol: :

Code: Select all

>>> timeit.timeit("shape_scale()", number=50000, setup="from __main__ import shape_scale")
6.068135397999868
>>> timeit.timeit("shape_matrix()", number=50000, setup="from __main__ import shape_matrix")
89.69596179099972
I blog about HVAC / BIM / Energy : pythoncvc.net. If you like you can follow the RSS feed.
User avatar
bernd
Posts: 8196
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Part.__fromPythonOCC__ issue : Segmentation fault

Postby bernd » Thu Aug 01, 2019 10:05 pm

:D