occ中如何创建带有洞口的拉伸体

occ官方demo中没有给出如何创建带有洞口的拉伸体的实例,通过查阅头文件,发现如下用法。

在通过 BRepBuilderAPI_MakeFace 类构造拉伸基准面时,通过 Add 函数添加开洞的区域。

  //! Adds the wire W to the constructed face as a hole.
  //! Warning
  //! W must not cross the other bounds of the face, and all
  //! the bounds must define only one area on the surface.
  //! (Be careful, however, as this is not checked.)
  //! Example
  //! // a cylinder
  //! gp_Cylinder C = ..;
  //! // a wire
  //! TopoDS_Wire W = ...;
  //! BRepBuilderAPI_MakeFace MF(C);
  //! MF.Add(W);
  //! TopoDS_Face F = MF;
  Standard_EXPORT void Add (const TopoDS_Wire& W);

构造好Face之后,可以正常使用各种拉伸扫略等造型函数。

posted @ 2022-04-14 16:24  李建业  阅读(130)  评论(0编辑  收藏  举报