Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

PythonOCC questions

PythonOCC questions
Andreas Lundberg 2009/10/02 15:28
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 2009/10/02 17:57
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: https://mail.gna.org/listinfo/pythonocc-users/. 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: http://www.pythonocc.org/APIREF/toc-OCC.Utils.Topology-module.html

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,

Thomas
Andreas Lundberg 2009/10/05 09:02
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 wxSamplesGui.py 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 http://www.pythonocc.org/APIREF/index.html). 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,
Andreas
Thomas Paviot 2009/10/05 15:25
Thanks for your feedback. The 0.4 release will come with a complete User's Guide.

Thomas
Andreas Lundberg 2009/10/23 08:40
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!
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map