hello sir,
I am a student at Dalian University of Technology. I am also learning your course about OCC in Youtube. Your courses are wonderful!
But an issue is confusing me. Hence, I need your help. I failed to convert a sphere geometry from a STEP file to a NURBS surface. At present, I have completed the reading of the step file,and obtained the model information through the Geom_BSplineSurface class, such as node vectors, control points, and weights.
The method I use is to extract a face in the model, convert it into a Geom_BSplineSurface, and then get the information. The code is as follows.
BRepBuilderAPI_NurbsConvert nurbs_convert;
nurbs_convert = BRepBuilderAPI_NurbsConvert(faceo);
nurbs_convert.Perform(faceo);
TopoDS_Shape face_shape = nurbs_convert.Shape();
Handle (Geom_Surface) h_geomface = BRep_Tool::Surface(TopoDS::Face(face_shape));
Handle(Geom_BSplineSurface)h_bsurface = GeomConvert::SurfaceToBSplineSurface(h_geomface);
Geom_BSplineSurface* bsurface = h_bsurface.get();
But I found that the knot range of this surface is not from 0 to 1 (not an open knot vector, from -15 to 15). I want to know which function can help me convert a surface geometry directly to a NUEBS but a B splines with irregular knot interval? Or how can I convert the node vector range of a surface into 0 to 1?
Thank you very much!
Regards,
Guangwu
I am a student at Dalian University of Technology. I am also learning your course about OCC in Youtube. Your courses are wonderful!
But an issue is confusing me. Hence, I need your help. I failed to convert a sphere geometry from a STEP file to a NURBS surface. At present, I have completed the reading of the step file,and obtained the model information through the Geom_BSplineSurface class, such as node vectors, control points, and weights.
The method I use is to extract a face in the model, convert it into a Geom_BSplineSurface, and then get the information. The code is as follows.
BRepBuilderAPI_NurbsConvert nurbs_convert;
nurbs_convert = BRepBuilderAPI_NurbsConvert(faceo);
nurbs_convert.Perform(faceo);
TopoDS_Shape face_shape = nurbs_convert.Shape();
Handle (Geom_Surface) h_geomface = BRep_Tool::Surface(TopoDS::Face(face_shape));
Handle(Geom_BSplineSurface)h_bsurface = GeomConvert::SurfaceToBSplineSurface(h_geomface);
Geom_BSplineSurface* bsurface = h_bsurface.get();
But I found that the knot range of this surface is not from 0 to 1 (not an open knot vector, from -15 to 15). I want to know which function can help me convert a surface geometry directly to a NUEBS but a B splines with irregular knot interval? Or how can I convert the node vector range of a surface into 0 to 1?
Thank you very much!
Regards,
Guangwu