本文是对于OCC中BRepBuilderAPI_Sewing类的详细解释,参考了OCC官方文档。
相关链接:BRepBuilderAPI_Sewing Class Reference - Open CASCADE Technology Documentation
目录
使用方式
添加头文件:
#include <BRepBuilderAPI_Sewing.hxx>
类内函数解析
构造函数
BRepBuilderAPI_Sewing::BRepBuilderAPI_Sewing (const Standard_Real tolerance=1.0e-06,
const Standard_Boolean option1=Standard_True,
const Standard_Boolean option2=Standard_True,
const Standard_Boolean option3=Standard_True,
const Standard_Boolean option4=Standard_False)
创建一个带有容差的对象,该对象具有是否进行缝合、分析退化形状、切割自由边缘、非流形处理四个选项。
成员函数
初始化函数,输入参数意义同构造函数。
//initialize the parameters if necessary.
void BRepBuilderAPI_Sewing::Init (const Standard_Real tolerance = 1.0e-06,
const Standard_Boolean option1 = Standard_True,
const Standard_Boolean option2 = Standard_True,
const Standard_Boolean option3 = Standard_True,
const Standard_Boolean option4 = Standard_False);
加载模型。
//Loades the context shape.
void BRepBuilderAPI_Sewing::Load (const TopoDS_Shape& shape);
定义和指定哪些几何形状(如曲面、边、面等)要进行缝合或处理。
//Defines the shapes to be sewed or controlled.
void BRepBuilderAPI_Sewing::Add (const TopoDS_Shape& shape);
执行缝合操作。
//theProgress - progress indicator of algorithm.
void BRepBuilderAPI_Sewing::Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
获得缝合后的模型。
//! Gives the sewed shape
//! a null shape if nothing constructed
//! may be a face, a shell, a solid or a compound
const TopoDS_Shape& BRepBuilderAPI_Sewing::SewedShape() const;
设置内容。关于BRepTools_ReShape类的解释可详见链接: BRepTools_ReShape Class Reference - Open CASCADE Technology Documentation
//set context
void BRepBuilderAPI_Sewing::SetContext (const Handle(BRepTools_ReShape)& theContext);
获得当前内容。
//return context
const Handle(BRepTools_ReShape)& BRepBuilderAPI_Sewing::GetContext();
获得自由边的数量,也即只在一个面上的边。
//Gives the number of free edges (edge shared by one face)
Standard_Integer BRepBuilderAPI_Sewing::NbFreeEdges() const;
获得第index条自由边,index为该边在所有自由边里的索引值。
//Gives each free edge
const TopoDS_Edge& BRepBuilderAPI_Sewing::FreeEdge (const Standard_Integer index) const;
获得多邻边的数量,也即被多个(两个以上)面共享的边。
//Gives the number of multiple edges
//(edge shared by more than two faces)
Standard_Integer BRepBuilderAPI_Sewing::NbMultipleEdges() const;
获得多第index条邻边,index为该边在所有多临边里的索引值。
//Gives each multiple edge
const TopoDS_Edge& BRepBuilderAPI_Sewing::MultipleEdge (const Standard_Integer index) const;
获得连续边的数量,也即被两张曲面共享的边的数量。
//Gives the number of contiguous edges (edge shared by two faces)
Standard_Integer BRepBuilderAPI_Sewing::NbContigousEdges() const;
获得第index条连续边,index为该边在连续边里的索引值。
//Gives each contiguous edge
const TopoDS_Edge& BRepBuilderAPI_Sewing::ContigousEdge (const Standard_Integer index) const;
获得第index组连续边。返回TopTools_ListOfShape(存shape的数组),里面是有相邻关系的edge。
//Gives the sections (edge) belonging to a contiguous edge
const TopTools_ListOfShape& BRepBuilderAPI_Sewing::ContigousEdgeCouple (const Standard_Integer index) const;
检测该edge是否为边界,若是边界返回true。
//Indicates if a section is bound (before use SectionToBoundary)
Standard_Boolean BRepBuilderAPI_Sewing::IsSectionBound (const TopoDS_Edge& section) const;
得到section的原始边,也即自由边界。section是当前缝合模型中的一条边,返回的是缝合前section所在面上的边界。通过这个原始边,我们可以找到这个section所在的曲面。
(这个解释为本人自己的理解,实际含义有待验证。如果验证发现理解有误或评论区有人指出错误将会进行修改。)
//Gives the original edge (free boundary) which becomes the
//the section. Remember that sections constitute common edges.
//This imformation is important for control because with
//original edge we can find the surface to which the section
//is attached.
const TopoDS_Edge& BRepBuilderAPI_Sewing::SectionToBoundary (const TopoDS_Edge& section) const;
获得退化形状的数量。(退化是如何定义的?)
//Gives the number of degenerated shapes
Standard_Integer BRepBuilderAPI_Sewing::NbDegeneratedShapes() const;
获得第index个退化形状,index为索引值。
//Gives each degenerated shape
const TopoDS_Shape& BRepBuilderAPI_Sewing::DegeneratedShape (const Standard_Integer index) const;
判断是否为退化形状,如果是返回true。
//Indicates if a input shape is degenerated
Standard_Boolean BRepBuilderAPI_Sewing::IsDegenerated (const TopoDS_Shape& shape) const;
未完待续。。。。。。