pythonocc

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

pythonocc

Post by Zolko »

looo wrote: Fri Jun 11, 2021 7:26 pm pythonocc: https://github.com/tpaviot/pythonocc-core
The conda based bundles have it included.
How to use this low-level feature ?
Are there some application examples ?
The FreeCAD wiki page about PythonOCC doesn't say anything.

For example, if I wanted to make an extrusion from a wire (result of a sketch): what would be the syntax ?
If I wanted to fuse 2 solids, what would be the syntax ?

Thanx
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: pythonocc

Post by onekk »

I think that the reason is explained in the wiki page itself.

PythonOCC is "a different way" of doing things, but is used by the IFCOpenShell "importer" so it is here to permit some interoperability between FreeCAD and PythonOCC.

Having tryed to use PythonOCC some times ago it is not so bad, but IMHO I think that FreeCAD is better.

So having it is handy, eventually the links at the bottom of the page will address to the proper documentation.

I think that the choice to focus on "documenting FreeCAD" is more correct than focusing on "document other softwares" that are not part of the "core part" of FreeCAD and are ancillary to some other part.

Good, bad, seeing what is happening around as opensource is heavily used by commercial softwares barely citing the use, (Most of the "tehc giants" rely on Opensource, and probably don't repay enough the community from the "hard work" spent in developing opensource software, and they are "making money" using opensource software)

my two cents
Best Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: pythonocc

Post by ickby »

To my knowledge pythonocc is a 1:1 wrapper of the opencascade API in python. So you can usually use the c++ documentation, which is somewhat extensive for occ, and figure the python API from it.

https://dev.opencascade.org/doc/overvie ... index.html does also have tutoris and samples.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pythonocc

Post by looo »

Zolko wrote: Wed Jun 16, 2021 3:03 pm
looo wrote: Fri Jun 11, 2021 7:26 pm pythonocc: https://github.com/tpaviot/pythonocc-core
The conda based bundles have it included.
How to use this low-level feature ?
Are there some application examples ?
The FreeCAD wiki page about PythonOCC doesn't say anything.

For example, if I wanted to make an extrusion from a wire (result of a sketch): what would be the syntax ?
If I wanted to fuse 2 solids, what would be the syntax ?

Thanx

I recently used it here [1]. Use it only if freecad has no python wrapper available.

[1] https://github.com/looooo/freecad.gears ... -854533568
Post Reply