OpenCascade Primitives BRep-Cone
eryar@163.com
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
本文通過(guò)在Draw Test Harness中的Tcl腳本來(lái)生成圓錐體Cone的邊界表示(BRep)數(shù)據(jù),通過(guò)對(duì)生成的數(shù)據(jù)進(jìn)行分析,來(lái)理解OpenCascade中的Cone的邊界表示方式。
如下圖所示為使用Tcl命令在Draw Test Harness中生成的圓錐體:
Figure 1.1 Cone Generated by Tcl in Draw Test Harness
2. Dump Cone BRep Info by Tcl
使用Tcl腳本在Draw Test Harness中輸出圓錐體(Cone)的邊界表示(BRep)數(shù)據(jù)的命令如下圖所示:
Figure 2.1 Dump Cone BRep Info by Tcl in Draw Test Harness
以上命令會(huì)生成一個(gè)圓心位于坐標(biāo)原點(diǎn)(0,0,0),半徑R為10,高度H為20的圓錐體,圓錐體的尺寸如下圖所示:
Figure 2.2 Cone Generated by Tcl Script
3. Cone BRep in OpenCascade
還是先從頂點(diǎn)(Vertex)開(kāi)始編號(hào),來(lái)對(duì)圓錐體(Cone)的邊界表示(BRep)進(jìn)行理解。從導(dǎo)出的BRep信息可以看出,圓錐體有兩個(gè)頂點(diǎn)(Vertex),對(duì)其編號(hào),如下圖所示:
Figure 3.1 Vertex of the Cone
圓錐體共有三條邊Edge,分別為Edge #7,Edge#8和Edge#10。現(xiàn)在來(lái)分析每條邊中的幾何信息。先來(lái)看看邊Edge#7的幾何信息:
Figure 3.2 Edge #7 of the Cone
三維空間曲線(xiàn)2是一個(gè)圓(Circle),取值范圍是[0,2PI]。由其參數(shù)可知此圓圓心位于原點(diǎn)(0,0,0),半徑為10,位于XOZ平面上,即圓錐的底面的圓。
曲面1上的參數(shù)曲線(xiàn)4的取值范圍是[0,2PI]。即PCurve4是位于原點(diǎn),沿U方向的直線(xiàn)。所以在取值范圍內(nèi)得到曲面上的參數(shù)分別是(0, 0)和(2PI, 0)。即曲面上v值恒為0,u從0到2PI。由圓錐面的參數(shù)方程可知:
這就是圓的參數(shù)方程。即與空間曲線(xiàn)2表示的是同一個(gè)圓。同理曲面2上的曲線(xiàn)5也一樣。
Figure 3.3 PCurve 4 on Surface 1 and PCurve5 on Surface 2 of the Cone
同理對(duì)Edge#8中的幾何信息進(jìn)行分析可知,其中有一條三維空間曲線(xiàn)1和曲面1上的閉合曲線(xiàn)2和3。它們都表示起點(diǎn)在(10,0,0)沿錐面上的一條斜線(xiàn)。
Figure 3.4 Edge#8 of the Cone
Edge#10中的幾何信息只有曲面1上的曲線(xiàn)1,對(duì)應(yīng)曲面上的參數(shù)分別為(0, 22.36)和(2PI, 22.36),且是退化邊,退化(Degenerated)成一個(gè)點(diǎn)。即當(dāng)v取22.36時(shí),曲線(xiàn)的參數(shù)方程為:
Figure 3.5 Edge #10 of the Cone
Figure 3.6 Wires of the Cone
由上圖可知,圓錐體有兩個(gè)環(huán)Wire,分別是Wire#4和Wire#6。其中環(huán)Wire#4就是圓錐體的底面圓環(huán)。將兩個(gè)環(huán)畫(huà)出如下圖所示:
Figure 3.7 Wires of the Cone
由兩個(gè)環(huán)Wire#4和Wire#6對(duì)應(yīng)的面Face#3和Face#5組成了殼Shell#2,殼Shell#2組成了體Solid#1。
4. Conclusion
通過(guò)Tcl生成的圓錐體Cone的邊界表示BRep信息,分析了OpenCascade中的圓錐體的邊界表示方式。
通過(guò)對(duì)OpenCascade中基本體Primitves的BRep信息進(jìn)行分析,來(lái)理解OpenCascade中的邊界表示方式。
通過(guò)使用Tcl腳本來(lái)輸出BRep信息,來(lái)熟悉Tcl命令,體驗(yàn)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