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.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Chris_G
Veteran
Posts: 2596
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Adding new OCCT classes to FreeCAD python

Post by Chris_G »

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
Founder
Posts: 20300
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Adding new OCCT classes to FreeCAD python

Post by wmayer »

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
Veteran
Posts: 2596
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Adding new OCCT classes to FreeCAD python

Post by Chris_G »

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: 656
Joined: Tue May 19, 2015 1:11 am

Re: Adding new OCCT classes to FreeCAD python

Post by ezzieyguywuf »

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

Re: Adding new OCCT classes to FreeCAD python

Post by mfasano »

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

Re: Adding new OCCT classes to FreeCAD python

Post by Chris_G »

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