当前位置: 首页 > news >正文

OCCT基础类库介绍:Modeling Algorithm - Topological Tools

Topological Tools

拓扑工具

Open CASCADE Technology topological tools provide algorithms to:

  • Create wires from edges;
  • Create faces from wires;
  • Compute state of the shape relatively other shape;
  • Orient shapes in container;
  • Create new shapes from the existing ones;
  • Build PCurves of edges on the faces;
  • Check the validity of the shapes;
  • Take the point in the face;
  • Get the normal direction for the face.

Open CASCADE Technology 拓扑工具提供了以下算法:

  • 从边创建线框(Wire);
  • 从线框创建面;
  • 计算形状相对于其他形状的状态;
  • 在容器中定向形状;
  • 从现有形状创建新形状;
  • 构建面上边的参数曲线(PCurves);
  • 检查形状的有效性;
  • 在面中取点;
  • 获取面的法向方向。

Creation of the faces from wireframe model

从线框模型创建面

It is possible to create the planar faces from the arbitrary set of planar edges randomly located in 3D space. This feature might be useful if you need for instance to restore the shape from the wireframe model:
可以从随机位于3D空间中的任意平面边集创建平面面。如果需要从线框模型恢复形状,此功能可能很有用:

线框模型 → 模型的面
在这里插入图片描述
在这里插入图片描述
To make the faces from edges it is, firstly, necessary to create planar wires from the given edges and than create planar faces from each wire. The static methods BOPAlgo_Tools::EdgesToWires and BOPAlgo_Tools::WiresToFaces can be used for that:

要从边创建面,首先需要从给定的边创建平面线框,然后从每个线框创建平面面。可以使用静态方法 BOPAlgo_Tools::EdgesToWiresBOPAlgo_Tools::WiresToFaces 实现这一点:

TopoDS_Shape anEdges = ...; /* 输入的边 */
Standard_Real anAngTol = 1.e-8; /* 区分线框所在平面的角度公差 */
Standard_Boolean bShared = Standard_False; /* 定义边是否共享 */
//
TopoDS_Shape aWires; /* 结果线框 */
Standard_Integer iErr = BOPAlgo_Tools::EdgesToWires(anEdges, aWires, bShared, anAngTol);
if (iErr) {cout << "Error: Unable to build wires from given edges\n";return;
}
//
TopoDS_Shape aFaces; /* 结果面 */
Standard_Boolean bDone = BOPAlgo_Tools::WiresToFaces(aWires, aFaces, anAngTol);
if (!bDone) {cout << "Error: Unable to build faces from wires\n";return;
}

These methods can also be used separately:

  1. BOPAlgo_Tools::EdgesToWires allows creating planar wires from edges. The input edges may be not shared, but the output wires will be sharing the coinciding vertices and edges. For this the intersection of the edges is performed. Although, it is possible to skip the intersection stage (if the input edges are already shared) by passing the corresponding flag into the method. The input edges are expected to be planar, but the method does not check it. Thus, if the input edges are not planar, the output wires will also be not planar. In general, the output wires are non-manifold and may contain free vertices, as well as multi-connected vertices.
  2. BOPAlgo_Tools::WiresToFaces allows creating planar faces from the planar wires. In general, the input wires are non-manifold and may be not closed, but should share the coinciding parts. The wires located in the same plane and completely included into other wires will create holes in the faces built from outer wires:

这些方法也可以单独使用:

  1. BOPAlgo_Tools::EdgesToWires
    允许从边创建平面线框。输入的边可以不共享,但输出的线框将共享重合的顶点和边。为此会执行边的相交计算。不过,如果输入的边已经共享,可以通过向方法传递相应标志来跳过相交阶段。输入的边应是平面的,但该方法不检查这一点。因此,如果输入的边不是平面的,输出的线框也将是非平面的。一般来说,输出的线框是非流形的,可能包含自由顶点以及多连通顶点。

  2. BOPAlgo_Tools::WiresToFaces
    允许从平面线框创建平面面。一般来说,输入的线框是非流形的,可能未闭合,但应共享重合部分。位于同一平面且完全包含在其他线框内的线框将在从外部线框构建的面中创建孔洞:

线框模型 → 两个面(红色面有一个孔洞)
在这里插入图片描述
在这里插入图片描述

Classification of the shapes

形状分类

The following methods allow classifying the different shapes relatively other shapes:
以下方法可用于相对于其他形状对不同形状进行分类:

  • The variety of the BOPTools_AlgoTools::ComputState methods classify the vertex/edge/face relatively solid;
    BOPTools_AlgoTools::ComputState 系列方法用于将顶点/边/面相对于实体进行分类;

  • BOPTools_AlgoTools::IsHole classifies wire relatively face;
    BOPTools_AlgoTools::IsHole 用于将线框相对于面进行分类;

  • IntTools_Tools::ClassifyPointByFace classifies point relatively face.
    IntTools_Tools::ClassifyPointByFace 用于将点相对于面进行分类。

Orientation of the shapes in the container

容器中形状的定向

The following methods allow reorienting shapes in the containers:
以下方法可用于重新定向容器中的形状:

  • BOPTools_AlgoTools::OrientEdgesOnWire correctly orients edges on the wire;
    BOPTools_AlgoTools::OrientEdgesOnWire 正确定向线框上的边;

  • BOPTools_AlgoTools::OrientFacesOnShell correctly orients faces on the shell.
    BOPTools_AlgoTools::OrientFacesOnShell 正确定向壳上的面。

Making new shapes

创建新形状

The following methods allow creating new shapes from the existing ones:
以下方法可用于从现有形状创建新形状:

  • The variety of the BOPTools_AlgoTools::MakeNewVertex creates the new vertices from other vertices and edges;
    BOPTools_AlgoTools::MakeNewVertex 系列方法从其他顶点和边创建新顶点;

  • BOPTools_AlgoTools::MakeSplitEdge splits the edge by the given parameters.
    BOPTools_AlgoTools::MakeSplitEdge 根据给定参数分割边。

Building PCurves

构建参数曲线(PCurves)

The following methods allow building PCurves of edges on faces:
以下方法可用于构建面上边的参数曲线:

  • BOPTools_AlgoTools::BuildPCurveForEdgeOnFace computes PCurve for the edge on the face;
    BOPTools_AlgoTools::BuildPCurveForEdgeOnFace 计算面上边的参数曲线;

  • BOPTools_AlgoTools::BuildPCurveForEdgeOnPlane and BOPTools_AlgoTools::BuildPCurveForEdgesOnPlane allow building PCurves for edges on the planar face;
    BOPTools_AlgoTools::BuildPCurveForEdgeOnPlaneBOPTools_AlgoTools::BuildPCurveForEdgesOnPlane 用于在平面面上构建边的参数曲线;

  • BOPTools_AlgoTools::AttachExistingPCurve takes PCurve on the face from one edge and attach this PCurve to other edge coinciding with the first one.
    BOPTools_AlgoTools::AttachExistingPCurve 从一个边获取面上的参数曲线,并将其附加到与第一条边重合的另一条边上。

Checking the validity of the shapes

检查形状的有效性

The following methods allow checking the validity of the shapes:
以下方法可用于检查形状的有效性:

  • BOPTools_AlgoTools::IsMicroEdge detects the small edges;
    BOPTools_AlgoTools::IsMicroEdge 检测微小边;

  • BOPTools_AlgoTools::ComputeTolerance computes the correct tolerance of the edge on the face;
    BOPTools_AlgoTools::ComputeTolerance 计算面上边的正确公差;

  • BOPTools_AlgoTools::CorrectShapeTolerances and BOPTools_AlgoTools::CorrectTolerances allow correcting the tolerances of the sub-shapes.
    BOPTools_AlgoTools::CorrectShapeTolerancesBOPTools_AlgoTools::CorrectTolerances 用于修正子形状的公差。

  • BRepLib::FindValidRange finds a range of 3d curve of the edge not covered by tolerance spheres of vertices.
    BRepLib::FindValidRange 查找边的3D曲线中未被顶点公差球覆盖的范围。

Taking a point inside the face

在面内取点

The following methods allow taking a point located inside the face:
以下方法可用于在面内获取一个点:

  • The variety of the BOPTools_AlgoTools3D::PointNearEdge allows getting a point inside the face located near the edge;
    BOPTools_AlgoTools3D::PointNearEdge 系列方法可获取面内靠近边的点;

  • BOPTools_AlgoTools3D::PointInFace allows getting a point inside the face.
    BOPTools_AlgoTools3D::PointInFace 可获取面内的一个点。

Getting normal for the face

获取面的法向量

The following methods allow getting the normal direction for the face/surface:
以下方法可用于获取面/曲面的法向方向:

  • BOPTools_AlgoTools3D::GetNormalToSurface computes the normal direction for the surface in the given point defined by UV parameters;
    BOPTools_AlgoTools3D::GetNormalToSurface 计算由UV参数定义的给定点处曲面的法向方向;

  • BOPTools_AlgoTools3D::GetNormalToFaceOnEdge computes the normal direction for the face in the point located on the edge of the face;
    BOPTools_AlgoTools3D::GetNormalToFaceOnEdge 计算位于面边上的点处面的法向方向;

  • BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge computes the normal direction for the face in the point located near the edge of the face.
    BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge 计算靠近面边的点处面的近似法向方向。

相关文章:

  • 今天我想清楚了
  • 无需公网IP:Termux+手机+内网穿透实现Minecraft远程多人联机
  • 基于大数据技术的在UGC数据分析与路线推荐的研究
  • ArcGIS中利用泰森多边形法分析站点与流域占比
  • VTK知识学习(54)- 交互与Widget(五)
  • ES 索引加载 vs BulkLoad
  • function ‘as_cholmod_sparse‘ not provided by package ‘Matrix‘
  • FreeCAD创作参数化凹形和水波纹式雨水箅子
  • 意法STM32F103C8T6 单片机ARM Cortex-M3 国民MCU 电机控制到物联网专用
  • Windows系统提示“mfc140u.dll丢失”?详细修复指南,一键恢复程序运行!
  • 智能制造——解读 51页制造业数据治理主数据管理系统建设方案【附全文阅读】
  • 从零Gazebo中实现Cartographer算法建图(新目录)
  • 如何使用 mkimage 工具生成 uImage 文件(RISC-V 环境)
  • 使用 Rust Clippy 的详细方案
  • JS使用~、>>、<<、>>>、|来取整,有啥区别
  • 软件技术专业的出路在哪
  • 【浏览器插件】如何开发一个Chrome浏览器插件
  • Flink基础知识
  • 实战指南:用DataHub管理Hive元数据
  • uni-app总结2-所需知识储备和学习途径
  • app制作平台靠谱吗/关键词排名优化方法
  • 响应式网站 图片处理/新闻热点大事件
  • 学校网站源码html/销售找客户最好的app
  • 专业做包包的网站/北京优化网站公司
  • php源码论坛/优化大师使用方法
  • 甘肃省路桥建设集团网站/郑州seo哪家专业