天天看點

OpenCascade Primitives BRep-Cone

OpenCascade Primitives BRep-Cone

<a href="mailto:[email protected]">[email protected]</a>

Abstract. BRep is short for Boundary Representation. Boundary Representation gives a complete description of an object by associating topological and geometric information for solid modeling. In this case, objects are described by their boundaries. There are two types of information in BRep: Topological information and Geometric information. This paper is concerned with the Cone BRep in OpenCascade, and also show how to use Tcl script to dump cone BRep info.

Key words. OpenCascade, BRep, Boundary Representation, Cone

1. Introduction

本文通過在Draw Test Harness中的Tcl腳本來生成圓錐體Cone的邊界表示(BRep)資料,通過對生成的資料進行分析,來了解OpenCascade中的Cone的邊界表示方式。

如下圖所示為使用Tcl指令在Draw Test Harness中生成的圓錐體:

OpenCascade Primitives BRep-Cone

Figure 1.1 Cone Generated by Tcl in Draw Test Harness

2. Dump Cone BRep Info by Tcl

使用Tcl腳本在Draw Test Harness中輸出圓錐體(Cone)的邊界表示(BRep)資料的指令如下圖所示:

OpenCascade Primitives BRep-Cone

Figure 2.1 Dump Cone BRep Info by Tcl in Draw Test Harness

以上指令會生成一個圓心位于坐标原點(0,0,0),半徑R為10,高度H為20的圓錐體,圓錐體的尺寸如下圖所示:

OpenCascade Primitives BRep-Cone

Figure 2.2 Cone Generated by Tcl Script

3. Cone BRep in OpenCascade

還是先從頂點(Vertex)開始編号,來對圓錐體(Cone)的邊界表示(BRep)進行了解。從導出的BRep資訊可以看出,圓錐體有兩個頂點(Vertex),對其編号,如下圖所示:

OpenCascade Primitives BRep-Cone

Figure 3.1 Vertex of the Cone

圓錐體共有三條邊Edge,分别為Edge #7,Edge#8和Edge#10。現在來分析每條邊中的幾何資訊。先來看看邊Edge#7的幾何資訊:

OpenCascade Primitives BRep-Cone

Figure 3.2 Edge #7 of the Cone

三維空間曲線2是一個圓(Circle),取值範圍是[0,2PI]。由其參數可知此圓圓心位于原點(0,0,0),半徑為10,位于XOZ平面上,即圓錐的底面的圓。

曲面1上的參數曲線4的取值範圍是[0,2PI]。即PCurve4是位于原點,沿U方向的直線。是以在取值範圍内得到曲面上的參數分别是(0, 0)和(2PI, 0)。即曲面上v值恒為0,u從0到2PI。由圓錐面的參數方程可知:

OpenCascade Primitives BRep-Cone
OpenCascade Primitives BRep-Cone

這就是圓的參數方程。即與空間曲線2表示的是同一個圓。同理曲面2上的曲線5也一樣。

OpenCascade Primitives BRep-Cone

Figure 3.3 PCurve 4 on Surface 1 and PCurve5 on Surface 2 of the Cone

同理對Edge#8中的幾何資訊進行分析可知,其中有一條三維空間曲線1和曲面1上的閉合曲線2和3。它們都表示起點在(10,0,0)沿錐面上的一條斜線。

OpenCascade Primitives BRep-Cone

Figure 3.4 Edge#8 of the Cone

Edge#10中的幾何資訊隻有曲面1上的曲線1,對應曲面上的參數分别為(0, 22.36)和(2PI, 22.36),且是退化邊,退化(Degenerated)成一個點。即當v取22.36時,曲線的參數方程為:

OpenCascade Primitives BRep-Cone
OpenCascade Primitives BRep-Cone

Figure 3.5 Edge #10 of the Cone

OpenCascade Primitives BRep-Cone

Figure 3.6 Wires of the Cone

由上圖可知,圓錐體有兩個環Wire,分别是Wire#4和Wire#6。其中環Wire#4就是圓錐體的底面圓環。将兩個環畫出如下圖所示:

OpenCascade Primitives BRep-Cone

Figure 3.7 Wires of the Cone

由兩個環Wire#4和Wire#6對應的面Face#3和Face#5組成了殼Shell#2,殼Shell#2組成了體Solid#1。

4. Conclusion

通過Tcl生成的圓錐體Cone的邊界表示BRep資訊,分析了OpenCascade中的圓錐體的邊界表示方式。

通過對OpenCascade中基本體Primitves的BRep資訊進行分析,來了解OpenCascade中的邊界表示方式。

通過使用Tcl腳本來輸出BRep資訊,來熟悉Tcl指令,體驗Tcl在便利。

5. References

1. OpenCascade, Test Harness User’s Guide 2013

2. OpenCascade, BRep Format Description White Paper, 2013

3. John K. Ousterhout, Tcl and Tk Toolkit, 1993