Extract NURBS surface data structures from STEP file

Hi,

I'm new to OCC technology and I'm looking for some guidance on a particular task. I'm working predominantly with NURBS surfaces that are exported as a STEP file from CAD software. What I want to do is read the STEP file and extract the NURBS data structures (i.e. knot vectors, degrees, control point connectivity, control point coordinates).

I've compiled the STEP reader example but I'm unsure what classes I will need to extend this code to extract the NURBS data. Can anyone point me in the right direction?

Thanks.

Robert

Shing Liu's picture

Hi Robert,

I think you can read the shape from STEP by occ STEP reader first,
then iterate the TopoDS_Shape by FACE, and this
can extract geometry surface data such as NURBS
surface data structures.

Best Regards,
Shing Liu

bobbiesimpson's picture

Yes, that does it.

But to follow on from this, I am slightly confused as to the relationship between the topology and geometry data structures in OCC. Let's assume I know the edges that surround a face that corresponds to a NURBS surface. I know how to extract control points, weights, knot vectors etc for this surface, but how would I determine the orientation of the parameter space with respect to the topology? For example, if my u-v parameter space was defined by the interval [0,1]x[0.1], how would I be able to determine the edge(s) that lie on u=0?

Am I thinking about this the right way? Any suggestions are welcome.

Forum supervisor's picture

Hello Robert,

The relation between parameter space of a surface (independently of its type - NURBS or anything else) and the edges of the corresponding face is given by the 2D curves (parametric curves) of these edges.

Should you have a wish to know better how topology and geometry are related in OCCT's Boundary Representation model, and also understand the algorithms that you might use in such or such case, consider our training courses, remote (E-learning) or on-site (Standard training). Some initial information about our training courses can be found at http://www.opencascade.org/support/training/.

Best regards,
Forum Supervisor