日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

OCCT的拓朴结构

發布時間:2023/12/18 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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: A??Vertex is a topological??point in??two or three dimensions 。
Tedge : A topological part??of a??curve??in 2D or 3D,??the boundary is a set of oriented????Vertices 。
Twire : A set of edges connected by their vertices 。
Tface: A??topological part??of a surface???or??of the??2D space.The??boundary??is??a???set of??wires???and 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 層描述了一個 Boundary??Representation Data???Structure ,并通過繼承 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 is??inherited from??the??Tedge from TopoDS. It contains the geometric data ,The TEdge contains :

???????* A tolerance.
???????* A same parameter flag.
???????* A same range flag.
???????* A Degenerated flag.
???????*??A??list???of curve representation.
?

屬性如下:

Standard_Real myTolerance;

Standard_Integer myFlags;

BRep_ListOfCurveRepresentation myCurves;

其中,比較復雜的是 listofcurve 屬性。每個 Edge 包含了一系列各類的 curve ,看一些 OCCT 的文檔說明:

An Edge is??defined by a list??of curve representations??which 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 this??flag??is True the??boundary of the??face is known to be the parametric space (Umin, UMax, VMin, VMax).
???????*??An????optional Triangulation.???If??there??is a triangulation the surface can be absent.
???????*??The??Location is??used???for the Surface.
???????*???The triangulation??is in the same reference system ??than the TFace.?????A point on mySurface must???be transformed with myLocation,??but??not a point??on the triangulation.
???????*???The Surface may??be shared by different TFaces but not the??Triangulation, because the??Triangulation may be modified by??the 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 個或多個內環。

總結

以上是生活随笔為你收集整理的OCCT的拓朴结构的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。