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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

OCCT的拓朴结构

發(fā)布時(shí)間:2023/12/18 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 OCCT的拓朴结构 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

??OCCT 的拓樸表示采用 BREP 形式,可以支持 non-manifold 實(shí)體。

???????OCCT 的拓樸表示分為兩層:拓樸對象層和 BREP 表示層。

???????先看拓樸對象層,如下是類繼承關(guān)系:

???????TopoDS_Shape

???????―― TopoDS_Solid

???????―― TopoDS_Shell

???????―― TopoDS_Face

???????―― TopoDS_Edge

???????―― TopoDS_CompSolid?

???????―― TopoDS_Compound?

???????―― TopoDS_Vertex??????

???????―― TopoDS_Wire

???????這里, shape 對象是一個(gè)對下層拓樸對象的引用( reference ),并記錄對象的位置和方向?qū)傩浴_@里可以針對不同位置或方向的同一個(gè)底層對象,實(shí)現(xiàn)共享。屬性三個(gè):

???????Handle_TopoDS_TShape myTShape;// 底層對象

TopLoc_Location myLocation;// 位置信息

TopAbs_Orientation myOrient;// 方向。

上述這些對象,都是一些引用,結(jié)構(gòu)和簡單。具體的拓樸信息和幾何信息在 Tshape 中。下面看 TopoDS_Tshape 的繼承關(guān)系:

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;

即每個(gè) Tshape 有一系列的 TopoDS_Shape (引用)組成,每個(gè)引用記錄的相應(yīng)的幾何信息和拓樸信息。例如:一個(gè) Twire 可能由多個(gè) 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 組成,每個(gè) TSolid 由一系列的 Shell 組成,每個(gè) TShell 由一系列的 Face 組成,每個(gè) TWire 由一系列的 Edge 組成,每個(gè) Tedge 由一系列的 Vertex 組成。當(dāng)然,不是隨便就可以組成的,還是有要求的,比如: Face 組成 Tshell 要求 Face 的邊境相連等。

上述的聲明和實(shí)現(xiàn)主要在 TopoDS package 中。

上述 TopoDS_T* 類,主要是上面顯示的兩種屬性。具體的幾何數(shù)據(jù)和拓樸數(shù)據(jù)由 BREP 層實(shí)現(xiàn)。

BREP 層描述了一個(gè) Boundary??Representation Data???Structure ,并通過繼承 TopoDS 層的類,添加了幾何信息。從上可以看出,有三個(gè)主要的實(shí)現(xiàn)類:

Brep_Tvertex 、 Brep_Tedge 、 Brep_Tface 類。

先從簡單的 Brep_Tvertex 類說起。 Tvertex 表示一個(gè)節(jié)點(diǎn)拓樸對象,包含了一個(gè) 3D 點(diǎn)信息和一個(gè) Tolerance 信息,如下:

gp_Pnt myPnt;

Standard_Real myTolerance;

BRep_ListOfPointRepresentation myPoints;

第三個(gè)屬性目前似乎沒有使用。

再看 Brep_Tedge 類,改類比較復(fù)雜,看 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;

其中,比較復(fù)雜的是 listofcurve 屬性。每個(gè) 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. 參數(shù)曲線
????* A curve on closed surface, two curves in parametric space. 例如圓柱的邊。
?

????--??Polygonal representations : 剖分后的數(shù)據(jù)。

????* 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.

??足夠的復(fù)雜了。下面看一些 list 中可能有那些類:

BRep_CurveRepresentation??????

―― BRep_PolygonOnTriangulation

―――― BRep_PolygonOnClosedTriangulation??????

―― BRep_PolygonOnSurface

―――― BRep_PolygonOnClosedSurface??????

―― BRep_Polygon3D????

―― BRep_GCurve

―――― BRep_Curve3D??????

―――― BRep_CurveOnSurface????

―――――― BRep_CurveOnClosedSurface

―― BRep_CurveOn2Surfaces?

這些類很多,后面再詳細(xì)補(bǔ)充,主要關(guān)注如下類:

Gcurve 類:表示是幾何曲線類,可能是 3D 曲線( Curve3D ),也可能是參數(shù)曲線( CurveOnSurface 類),而參數(shù)曲線可能是閉合曲線的參數(shù)曲線( CurveOnClosedSurface 類)。

裁剪曲面中,裁剪環(huán)中的裁剪曲線,就是使用 CurveOnSurface 表示的。

通常,如果一條曲線是單獨(dú)的 3D 曲線,則 listofcurve 中通常只包含 Curve3d 。如果一個(gè)曲線是一個(gè)裁剪曲線,則通常包括一條 3d 曲線和一個(gè)參數(shù)曲線。當(dāng)所在曲面進(jìn)行了剖分后,則還會有對于的 polygon 數(shù)據(jù)。這也是為什么使用 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; 關(guān)聯(lián)的 geom 層的曲面信息,這個(gè)曲面可能是無界曲面,例如: Plane 。
Handle_Poly_Triangulation myTriangulation; Face 網(wǎng)格剖分后生成的網(wǎng)格數(shù)據(jù)。主要用于顯示時(shí)使用。
TopLoc_Location myLocation; 曲面的位置信息,為了便于同一個(gè)曲面在不同位置顯示時(shí)的數(shù)據(jù)共享。
Standard_Real myTolerance; 曲面的誤差。
Standard_Boolean myNaturalRestriction; 是否自然參數(shù)限制的曲面,當(dāng)是自然限制時(shí),曲面被矩形參數(shù)區(qū)域[U1,U2] × [V1,V2] 限制,否則,為裁剪曲線限制,參數(shù)裁剪區(qū)域通常不是規(guī)則的矩形區(qū)域。
?

通常,一個(gè)裁剪曲面 Tface ,除包含上述信息外,還會包含一系列的 Wire 子 shape ,這些 wire 構(gòu)成了 Tface 的多個(gè)裁剪環(huán),其中一個(gè)為外環(huán), 0 個(gè)或多個(gè)內(nèi)環(huán)。

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。