Adding new OCCT classes to FreeCAD python

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Chris_G
Posts: 1255
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Adding new OCCT classes to FreeCAD python

Postby Chris_G » Thu Nov 28, 2019 1:04 pm

Thanks to all for the help.
Ickby, I agree.
Some of the occt naming is not very meaningful.
And I don't like the AppDef name neither.
"Approximation" would be way better.
wmayer
Site Admin
Posts: 15487
Joined: Thu Feb 19, 2009 10:32 am

Re: Adding new OCCT classes to FreeCAD python

Postby wmayer » Thu Nov 28, 2019 1:05 pm

ickby wrote:
Thu Nov 28, 2019 10:12 am
Just a general question about the naming: Is this occt sheme of naming a good idea? it seems extremely un-freecad-like. It is already pretty bad for the "BRepOffsetAPI_" things already exposed: it is completely unintuitive in the freecad environment to use occt prefixes. I'm all for exposing more functionality, but why not using it in the existing shape API? Or creating just a some logical sounding subpackages in part, like

Code: Select all

Part.Approximation.MultiPointConstraint
IMHO the mixing of freecad style and ocp style makes the API much worse.
Yes, you're right. At the moment we have only one of the BRepOffset classes exposed to Python but if we do more of them we should think about making packages to make it more Pythonic.
User avatar
Chris_G
Posts: 1255
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Adding new OCCT classes to FreeCAD python

Postby Chris_G » Thu Nov 28, 2019 1:08 pm

wmayer wrote:
Thu Nov 28, 2019 1:05 pm
Yes, you're right. At the moment we have only one of the BRepOffset classes exposed to Python but if we do more of them we should think about making packages to make it more Pythonic.
So, I suppose I should take Geom2d as model for Approximation.
ezzieyguywuf
Posts: 637
Joined: Tue May 19, 2015 1:11 am

Re: Adding new OCCT classes to FreeCAD python

Postby ezzieyguywuf » Thu Nov 28, 2019 8:57 pm

+1 I think we should make the naming more sane.
mfasano
Posts: 64
Joined: Wed Apr 11, 2018 12:31 pm

Re: Adding new OCCT classes to FreeCAD python

Postby mfasano » Wed Dec 04, 2019 2:02 pm

User avatar
Chris_G
Posts: 1255
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Adding new OCCT classes to FreeCAD python

Postby Chris_G » Wed Dec 04, 2019 3:10 pm

Yes it is.
If I had seen this 2 weeks ago, I would have tried with PythonOCC first, probably.
Thanks