200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > OCCT的拓朴结构

OCCT的拓朴结构

时间:2022-02-07 17:16:01

相关推荐

OCCT的拓朴结构

OCCT 的拓朴表示采用 BREP 形式,可以支持 non-manifold 实体。

OCCT 的拓朴表示分为两层:拓朴对象层和 BREP 表示层。

先看拓朴对象层,如下是类继承关系:

TopoDS_Shape

―― TopoDS_Solid

―― TopoDS_Shell

―― TopoDS_Face

―― TopoDS_Edge

―― TopoDS_CompSolid

―― TopoDS_Compound

―― TopoDS_Vertex

―― TopoDS_Wire

这里, shape 对象是一个对下层拓朴对象的引用( reference ),并记录对象的位置和方向属性。这里可以针对不同位置或方向的同一个底层对象,实现共享。属性三个:

Handle_TopoDS_TShape myTShape;// 底层对象

TopLoc_Location myLocation;// 位置信息

TopAbs_Orientation myOrient;// 方向。

上述这些对象,都是一些引用,结构和简单。具体的拓朴信息和几何信息在 Tshape 中。下面看 TopoDS_Tshape 的继承关系:

TopoDS_TShape

―― TopoDS_TWire

―― TopoDS_TVertex

―――― BRep_TVertex

―― TopoDS_TSolid

―― TopoDS_TShell

―― TopoDS_TFace

―――― BRep_TFace

―― TopoDS_TEdge

―――― BRep_TEdge

―― TopoDS_TCompSolid

―― TopoDS_TCompound

这里 TopoDS 开始的类是拓朴层的类, Brep 开始的类是具体的 BREP 表示层的类。 Tshape 具有如下主要的属性:

TopoDS_ListOfShape myShapes;

Standard_Integer myFlags;

即每个 Tshape 有一系列的 TopoDS_Shape (引用)组成,每个引用记录的相应的几何信息和拓朴信息。例如:一个 Twire 可能由多个 Edge 组成等。如下是类的一些简单说明:

Tvertex: AVertex is a topologicalpoint intwo or three dimensions 。

Tedge : A topological partof acurvein 2D or 3D,the boundary is a set of orientedVertices 。

Twire : A set of edges connected by their vertices 。

Tface: Atopological partof a surfaceorof the2D space.Theboundaryisaset ofwiresand vertices.

Tshell : A set of faces connected by their edges.

Tsolid: A Topological part of 3D space, bounded by shells, edges and vertices.

TCompSolid; A set of solids connected by their faces.

TCompound; A TCompound is an all-purpose set of Shapes.

总之, TcompSolid 由一系列的 Solid 组成,每个 TSolid 由一系列的 Shell 组成,每个 TShell 由一系列的 Face 组成,每个 TWire 由一系列的 Edge 组成,每个 Tedge 由一系列的 Vertex 组成。当然,不是随便就可以组成的,还是有要求的,比如: Face 组成 Tshell 要求 Face 的边境相连等。

上述的声明和实现主要在 TopoDS package 中。

上述 TopoDS_T* 类,主要是上面显示的两种属性。具体的几何数据和拓朴数据由 BREP 层实现。

BREP 层描述了一个 BoundaryRepresentation DataStructure ,并通过继承 TopoDS 层的类,添加了几何信息。从上可以看出,有三个主要的实现类:

Brep_Tvertex 、 Brep_Tedge 、 Brep_Tface 类。

先从简单的 Brep_Tvertex 类说起。 Tvertex 表示一个节点拓朴对象,包含了一个 3D 点信息和一个 Tolerance 信息,如下:

gp_Pnt myPnt;

Standard_Real myTolerance;

BRep_ListOfPointRepresentation myPoints;

第三个属性目前似乎没有使用。

再看 Brep_Tedge 类,改类比较复杂,看 OCCT 的文档说明:

The TEdge from BRep isinherited fromtheTedge from TopoDS. It contains the geometric data ,The TEdge contains :

* A tolerance.

* A same parameter flag.

* A same range flag.

* A Degenerated flag.

*Alistof curve representation.

属性如下:

Standard_Real myTolerance;

Standard_Integer myFlags;

BRep_ListOfCurveRepresentation myCurves;

其中,比较复杂的是 listofcurve 属性。每个 Edge 包含了一系列各类的 curve ,看一些 OCCT 的文档说明:

An Edge isdefined by a listof curve representationswhich are either :

--Geometric representations :

* A 3d curve (at most one)3D 曲线。

* A curve on surface, curve in parametric space. 参数曲线

* A curve on closed surface, two curves in parametric space. 例如圆柱的边。

--Polygonal representations : 剖分后的数据。

* A 3d polygon (at most one).

* A Polygon on triangulation (array of node indices)

* A Polygon on closed triangulation (2 arrays of node indices)

* A polygon on surface (array of 2d points in parametric space)

--Curve on 2 surfaces :

* This is used for storing shape continuity.

足够的复杂了。下面看一些 list 中可能有那些类:

BRep_CurveRepresentation

―― BRep_PolygonOnTriangulation

―――― BRep_PolygonOnClosedTriangulation

―― BRep_PolygonOnSurface

―――― BRep_PolygonOnClosedSurface

―― BRep_Polygon3D

―― BRep_GCurve

―――― BRep_Curve3D

―――― BRep_CurveOnSurface

―――――― BRep_CurveOnClosedSurface

―― BRep_CurveOn2Surfaces

这些类很多,后面再详细补充,主要关注如下类:

Gcurve 类:表示是几何曲线类,可能是 3D 曲线( Curve3D ),也可能是参数曲线( CurveOnSurface 类),而参数曲线可能是闭合曲线的参数曲线( CurveOnClosedSurface 类)。

裁剪曲面中,裁剪环中的裁剪曲线,就是使用 CurveOnSurface 表示的。

通常,如果一条曲线是单独的 3D 曲线,则 listofcurve 中通常只包含 Curve3d 。如果一个曲线是一个裁剪曲线,则通常包括一条 3d 曲线和一个参数曲线。当所在曲面进行了剖分后,则还会有对于的 polygon 数据。这也是为什么使用 list 记录这些信息的原因。

先到这里,下面看 Tface 。

先看 OCCT 文档说明:

The TFace contains :

* A suface, a tolerance and a Location.

* A NaturalRestriction flag,when thisflagis True theboundary of theface is known to be the parametric space (Umin, UMax, VMin, VMax).

*Anoptional Triangulation.Ifthereis a triangulation the surface can be absent.

*TheLocation isusedfor the Surface.

*The triangulationis in the same reference system than the TFace.A point on mySurface mustbe transformed with myLocation,butnot a pointon the triangulation.

*The Surface maybe shared by different TFaces but not theTriangulation, because theTriangulation may be modified bythe edges.

Tface 包括如下属性:

Handle_Geom_Surface mySurface; 关联的 geom 层的曲面信息,这个曲面可能是无界曲面,例如: Plane 。

Handle_Poly_Triangulation myTriangulation; Face 网格剖分后生成的网格数据。主要用于显示时使用。

TopLoc_Location myLocation; 曲面的位置信息,为了便于同一个曲面在不同位置显示时的数据共享。

Standard_Real myTolerance; 曲面的误差。

Standard_Boolean myNaturalRestriction; 是否自然参数限制的曲面,当是自然限制时,曲面被矩形参数区域[U1,U2] × [V1,V2] 限制,否则,为裁剪曲线限制,参数裁剪区域通常不是规则的矩形区域。

通常,一个裁剪曲面 Tface ,除包含上述信息外,还会包含一系列的 Wire 子 shape ,这些 wire 构成了 Tface 的多个裁剪环,其中一个为外环, 0 个或多个内环。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。