>> 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?

Loop over the topology, using:

from OCC.Utils.Topology import Topo
explore = Topo( yourTopoDS_* instance )


# adapt the edge to a curve
from OCC.BRepAdaptor import *


for edg in explore.edges():
        # returns a Geom_BSplineCurve
        crv = BRepAdaptor_Curve( edg ).BSpline()
        if crv.BSpline():
                for knot in crv.Knots():
                        # do something useful with your spline
        elif crv.Line():
                # not a BSpline ;')
                # returns gp_Lin, the OCC line primitive
        
Check out the Geom module in Modelling Data for useful methods of  
dealing with your spline.

-jelle

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to