PythonOCC questions


Hello, everybody.
I've lurked around the OCC community for a few weeks now, and I finally have a few questions.

1) Is there an active PythonOCC forum/wiki/IRC channel/mailing list/user group/blog?
The official wiki seems pretty dead (two updates in the last 30 days), and doesn't really contain anything of value. This forum has a couple of threads about it, but they're not particularly recent even though the latest version of PythonOCC was released just in August. Where do the developers hang out? Where do users go to gripe about installation issues, missing features, or other questions?

2) In fact I have just such a question, so I hope I'm in the right place. I installed the Python 2.5 version of the Win32 PythonOCC module, btw.:
I have a TopoDS_Shape, incidentally a result from BRepBuilderAPI_Transform.ModifiedShape(). I want the corresponding wire to this shape. I can't really do a type-cast because it's Python, not C++. I tried passing the shape to the TopoDS_Wire.__init__() function, with no success. I also tried passing it to BRepBuilderAPI_MakeWire(), which didn't work.
How do I get a TopoDS_Wire from a TopoDS_Shape?

3) Is there a roadmap or some other indication of the changes planned for PythonOCC, and the expected time-table? I'm super-impressed looking at the project log - from very basic release to (nearly) fully functional product in 6 months! What's next?

Thomas Paviot's picture

Hi Andreas,

1. The pythonOCC wiki is not dead, but is not very active due to a lack of time. On the other hand, I don't really know what you mean with something of value. What content do you want to see on this wiki? This answer would be much appreciated and could help me in the way the wiki has to evolve to fit with user needs.

The best way to get information is to suscribe the pythonocc-users ml: It's much more active, and you'll get you answer very quickly.

2. pythonOCC comes with a high level topology module based on built-in OCC objects:

from OCC.BRepPrimAPI import *
from OCC.Utils.Topology import *
box_shape = BRepPrimAPI_MakeBox(100,100,100).Shape()
topo = Topo(box_shape)
print dir(topo)

The available methods are:
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribut
e__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_e
x__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_
_weakref__', '_loop_topo', '_map_shapes_and_ancestors', '_number_of_topo', '_num
ber_shapes_ancestors', 'comp_solids', 'compounds', 'edges', 'edges_from_face', '
edges_from_vertex', 'edges_from_wire', 'faces', 'faces_from_edge', 'faces_from_s
olids', 'faces_from_vertex', 'faces_from_wire', 'myShape', 'number_of_comp_solid
s', 'number_of_compounds', 'number_of_edges', 'number_of_edges_from_face', 'numb
er_of_edges_from_vertex', 'number_of_edges_from_wire', 'number_of_faces', 'numbe
r_of_faces_from_edge', 'number_of_faces_from_solids', 'number_of_faces_from_vert
ex', 'number_of_faces_from_wires', 'number_of_ordered_edges_from_wire', 'number_
of_ordered_vertices_from_wire', 'number_of_shells', 'number_of_solids', 'number_
of_solids_from_face', 'number_of_vertices', 'number_of_vertices_from_edge', 'num
ber_of_vertices_from_face', 'number_of_wires', 'number_of_wires_from_edge', 'num
ber_of_wires_from_face', 'ordered_edges_from_wire', 'ordered_vertices_from_wire'
, 'shells', 'solids', 'solids_from_face', 'vertices', 'vertices_from_edge', 'ver
tices_from_face', 'wires', 'wires_from_edge', 'wires_from_face']

Here is the link to the documentation of the Topo class:

Please let's continue this topic on the pythonocc-users ml.

3. The next release (0.4) will focus on:
- 64 bit support for both Win/Linux/MacOS
- Multiple graphical backends (wx, PyQt, python-xlib),
- many more samples,
- smesh integration.
Development is very active and changes are commited almost each day.

Best Regards,


TheWalruss's picture

Hi Thomas, thanks for the quick reply!

1) Things that I'd like to see on the Wiki - as I get more familiar with PythonOCC, I'll contribute what I can, of course:
* I like the OCCConceptMap, although it does need to be expanded.
* A "Getting Started" tutorial. Expanding the example to accommodate manipulating primitives, perhaps.
* A discussion of how PythonOCC is built. I can't say I understand how SWIG interacts with the OpenCascade source files and the PythonOCC installation scripts, and having that insight would probably help one in using PythonOCC. Then again, I could be wrong.
* Pages backlinking to the API reference (at I'm really impressed by the API reference. It has even helped me comprehend more about how OpenCascade works outside of the Python wrapper. However, there's a lack of "human-friendly" usability discussion, like what is available for Java. Perhaps the wiki is the right medium for this? I like this idea mainly because it's open - there is no way anybody could systematically supply this information for all the available classes, but this wiki section could grow organically.
* "How to" section, listing common problems and solutions. The information here would mainly come from the mailing list and this forum, the benefit of having it in the wiki being that it's more searchable and a central location, where corrections/additions/relevant links are easy to add and maintain.

Those are my thoughts about the wiki. Lots of work, of course, and who has the time? That's the main problem with wiki-style communication. I personally attach a lot of value to good wikis, but other people don't like them as much, so if nobody else is interested in the above points and think the mailing list is sufficient, that's fine too.

2. I'll try this right now.

3. Looks great!

Best Regards,

Thomas Paviot's picture

Thanks for your feedback. The 0.4 release will come with a complete User's Guide.


TheWalruss's picture

I haven't been as active (at all) in the PythonOCC mailing list or made any additions to the wiki - it turns out my project took an unexpected turn into C++, so I've been working with OpenCascade directly.
That said, I might end up using PythonOCC for a project at home, so I'm looking forward to getting back into it!