On Thu, Jan 21, 2010 at 10:47 AM, Charles McCreary
<[email protected]> wrote:
> Now I want to extract some information from the imported geometry. The
> geometry consists of 3 b-spline curves with knots. I've perused the doxygen
> generated documents but I'm still rather lost on how to begin. I'm unclear
> on how to even start a simple task like extracting the points from the
> spline. Suggestions?
Holy crap, a PE :-). Welcome aboard Charles. Let's see if this does the trick:
def process_shape(shape):
'''extracts faces from a shape
note: if this doesnt work you should try process_face(shape)
returns a list of faces'''
faces = []
explorer = TopExp_Explorer(shape, TopAbs_FACE)
while explorer.More():
face = TopoDS().Face(explorer.Current())
faces.append(face)
explorer.Next()
return faces
def process_face(face):
'''traverses a face for wires
returns a list of wires'''
wires = []
explorer = TopExp_Explorer(face, TopAbs_EDGE)
while explorer.More():
edge = TopoDS().Edge(explorer.Current())
wire = BRepBuilderAPI_MakeWire(edge).Wire()
wires.append(wire)
explorer.Next()
return wires
At least, this might get you a good head start: check out the
TopExp_Explorer class for sure. Another good technique is to use
bpython-interpreter.org, which can really help figure out pythonOCC's
deep internals without too much pain. Also, some of us pythonOCC users
are in #hplusroadmap on irc.freenode.net if you would like real-time
support over IRC.
- Bryan
http://heybryan.org/
1 512 203 0507
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users