BRepBuilderAPI_MakePolygon类
创建一个polygonal wires,可以通过一组点或向量生成,也可以先生成一个空的对象,再添加点。
BRepOffsetAPI_MakeEvolved类
创建一个可展图形,它是通过一个planar spine (face or wire)和一个profile (wire)来生成的,它是一个非循环的sweep (pipe),用profile沿着spline;自相交点将被移除
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <TopoDS_Wire.hxx>
#include <BRepOffsetAPI_MakeEvolved.hxx>
#include"Viewer.h"
int main(int argc, char* argv[])
{BRepBuilderAPI_MakePolygon P;P.Add(gp_Pnt(0., 0., 0.));P.Add(gp_Pnt(200., 0., 0.));P.Add(gp_Pnt(200., 200., 0.));P.Add(gp_Pnt(0., 200., 0.));P.Add(gp_Pnt(0., 0., 0.));TopoDS_Wire W = P.Wire();TopoDS_Wire wprof = BRepBuilderAPI_MakePolygon(gp_Pnt(0., 0., 0.), gp_Pnt(-60., -60., -200.));TopoDS_Shape S = BRepOffsetAPI_MakeEvolved(W, wprof, GeomAbs_Arc, Standard_True, Standard_False,Standard_True, 0.0001);Viewer vout(50, 50, 500, 500);vout << W;vout << wprof;vout << S;vout.StartMessageLoop();return 0;
}