2017-01-11 46 views
0

我正尝试在OpenCASCADE中更改现有TopoDS_Shape的几何图形。一种可能的应用是修改身体的边缘而不需要重建整个身体(例如,改变圆柱体的一个帽的半径,移动Bspline曲线/表面中的控制点)。如何在OpenCASCADE中更改TopoDS_Shape的底层几何图形

  • 在OpenCASCADE中有这样的标准方法吗?
  • 是否可以在不创建新形状的情况下更新几何图形?

我已经尝试使用BRepAdaptor_HCurve代替,但这并没有真正的帮助。

Handle(Geom_Circle) aCircle = new Geom_Circle(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 5); // create a circle in the xy plane, origin (0,0,0) radius 5; 
TopoDS_Edge circ = BRepBuilderAPI_MakeEdge(aCircle); // switch to topological description; 

STEPControl_Writer writer; 

writer.Transfer(circ,STEPControl_AsIs); // access topology for output 

BRepAdaptor_Curve theAdaptor = BRepAdaptor_Curve(circ); // create an adaptor  
gp_Circ mod_circ = theAdaptor.Circle(); 
mod_circ.SetRadius(1); // change radius to 1 

// I dont want to create a new circle, but reuse the old one with the updated geometry: 
// writer.Transfer(circ, STEPControl_AsIs); // access topology for output 

// in order to output the updated geometry, we also have to create a new edge 
TopoDS_Edge another_circ = BRepBuilderAPI_MakeEdge(mod_circ); 

writer.Transfer(another_circ, STEPControl_AsIs); // access topology for output 
writer.Write("debug.stp"); 

原始和改进的几何形状,通过写circanother_circ Original and modified geometry

回答

相关问题