opencascade簡單形狀的輪廓面偏置生成

針對一些簡單的形狀,可以利用OCC中的函數直接生成其輪廓面的偏置形狀
BRepOffsetAPI_MakeOffsetShape aShapeMaker1;
//aShapeMaker1.PerformByJoin(input,30,0.01);//第一種生成方式
aShapeMaker1.PerformBySimple(input, 20);//第二種生成方式,input為輸入的TopoDS_Shape形狀
TopoDS_Shape offsetBox = aShapeMaker1.Shape();
Handle(AIS_Shape)ais_shape = new AIS_Shape(offsetBox);
m_context->SetTransparency(ais_shape, 0.1, this);//顯示
m_context->SetColor(ais_shape, Quantity_NOC_GRAY, Standard_True);
m_context->Display(ais_shape, Standard_True);
m_view->FitAll();
更多的偏置功能參考以下類: