can occ manipulate nurbs

I hope to develop some software which can manipulate the control points of a NURBS, then cross the NURBS with some 3d curve to find the cross point. Can OCC do it?

also I hope to manipulate the modification by mouse in 3D window, is it available?

If yes, can anybody give me some suggestion?

Laszlo Kudela's picture


yes, OpenCASCADE is capable of doing such things. You did not mention if you want to compute with NURBS surfaces or curves, though. The class responsible for handling curves is Geom_BSplineCurve , for surfaces you can use Geom_BSplineSurface. Contrary to the what the name suggests, these classes are also able to handle NURBS, because you can pass weights of the control points (or poles) in the constructor.

Computing the intersection between a 3D NURBS curve and any other parametric curve is a little bit tricky, because you have to solve 3 equations for 2 unknowns. As far as I know, people usually use here GeomAPI_ExtremaCurveCurve to compute a minimum distance between the curves and then check if the minimum distance lies under some tolerance. If it does, you can further check the curve tangent vectors at that point to see if it is really an intersection or not.

To compute the intersection between a NURBS surface and a parametric curve, you can use GeomAPI_IntCS, .

Concerning moving points around interactively, I don't have much experience with that, but I guess you could update the table of control points using SetPole() or use MovePoint() in the Geom_BSplineCurve/Geom_BSplineSurface classes. I have never used these functions, so maybe someone with more experience could confirm if these functions would work out or not.