Hello, I'm RGW.
I read a step model, then converted one of the TopoDS_Face to Geom_BSplineSurface, and then reparametrized the Geom_BSplineSurface, now I want to re-convert the reparametrized Geom_BSplineSurface to TopoDS_Face, but I found that there is a problem with the result of my conversion: a circle surface becomes a square. How can I do it to get the result I want?
Below is my code and conversion result.
The left image is the original graph, which is the result I want to get.
The right image is the wrong result of my code running.
I read a step model, then converted one of the TopoDS_Face to Geom_BSplineSurface, and then reparametrized the Geom_BSplineSurface, now I want to re-convert the reparametrized Geom_BSplineSurface to TopoDS_Face, but I found that there is a problem with the result of my conversion: a circle surface becomes a square. How can I do it to get the result I want?
Below is my code and conversion result.
Code:
//convert a face_shape to Geom_BSplineSurface
TopoDS_Face faceo = TopoDS::Face(face_shape);
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);
//Reparametrize u dir
Standard_Integer nbuk = h_bsurface->NbUKnots();
TColStd_Array1OfReal uk(1, nbuk);
BSplCLib::Reparametrize(0, 1, uk);
h_bsurface->SetUKnots(uk);
//Reparametrize v dir
Standard_Integer nbvk = h_bsurface->NbVKnots();
TColStd_Array1OfReal vk(1, nbvk);
BSplCLib::Reparametrize(0, 1, vk);
h_bsurface->SetVKnots(vk);
//convert Geom_BSplineSurface to TopoDS_Face
TopoDS_Face res = BRepBuilderAPI_MakeFace(h_bsurface, Precision::Approximation());
The left image is the original graph, which is the result I want to get.
The right image is the wrong result of my code running.