0
0
0
1. 云栖社区>
2. 博客>
3. 正文

## OpenCASCADE PCurve of Topological Face

eryar 2015-04-25 12:22:00 浏览961

### OpenCASCADE PCurve of Topological Face

Abstract. OpenCASCADE provides a class BRepBuilderAPI_MakeFace to build topological faces. A face maybe built from a surface, elementary surface from gp package, surface from Geom, from a wire and find the surface automatically if possible, etc. If a face is built, how to check it for visualization? What does PCurve means? The paper will answer those question.

Key Words. OpenCASCADE, Topological Face, PCurve, Holes

1. Introduction

2.PCurve of a Face

Figure 2.1 Mesh UV domain of a Surface

Figure 2.2 A Smiley Face Meshed by Triangle

2.1 Plane PCurve

# 1. view the pcurves of a plane face
plane p

# trim the plane to (u,v)->[-1, 1][-1, 1]
trim p p -1 1 -1 1

# make the topo face
mkface p p

# extract the 2d curve of an edge on a face
pcurve p

# display pcurve in 2d viewer
av2d
fit
2dfit

# display face in 3d viewer
vdisplay p

Figure 2.3 Color for PCurves

v rouge: FORWARD 胭脂红表示正向；

v bleu: REVERSED 蓝色表示反向；（不知道是法语写法还是个错别字，蓝色英语应该为blue）

v rose: EXTERNAL 玫瑰红表示向外；

v orange: INTERNAL 橙黄色表示向内；

Figure 2.4 Plane PCurves

Figure 2.5 Plane Face in 3D Viewer

2.2 Cylinder PCurve

# 2. view the pcurves of a cylinder face
cylinder c 1

# trim the cylinder to (u,v)->[0, 2pi][0, 1]
trim c c 0 2*pi 0 1

# make the topo face
mkface c c

# extract the 2d curve of an edge on a face
pcurve c

# display pcurves in 2d viewer
av2d
2dfit
fit

# display face in 3d viewer
vdisplay c

Figure 2.6 Cylinder PCurves

Figure 2.7 Cylinder Face in 3d Viewer

3.3 Cone PCurve

# 3. view the pcurves of a cone face
cone co 30 0

# trim the cone to (u,v)->[0, 2pi][0, 1]
trim co co 0 2*pi 0 1

# make the topo face
mkface co co

# extract pcurves
pcurve co

# display pcurves in 2d viewer
av2d
2dfit
fit

# display face in 3d viewer
vdisplay co

Figure 2.8 Cone PCurves

Figure 2.9 Cone Face in 3D viewer

3.4 Sphere PCurve

# 4. view the pcurves of a sphere face
sphere s 1

# make the topo face
mkface s s

# extract pcurves
pcurve s

# display pcurves in 2d viewer
av2d
2dfit
fit

# display sphere face in 3d viewer
vdisplay s

Figure 2.10 Sphere PCurves

Figure 2.11 Sphere in 3d viewer

3.5 Torus PCurve

# 5. view the pcurves of a torus face
torus t 20 5

# make the topo face
mkface t t

# extract pcurves
pcurve t

# display pcurves in 2d viewer
av2d
2dfit
fit
# display torus in 3d viewer
vdisplay t

Figuer 2.12 Torus PCurves

Figure 2.13 Torus in 3d viewer

3.PCurve of a Face With Holes

Figure 3.1 Parametric Trimming Curves

# test face with one hole
plane p
trim p p
-10 10 -10 10
mkface p p
pcylinder c
1 2

bop p c
bopcut s

vdisplay s

explode s F
pcurve s_1

av2d
2dfit
fit

Figure 3.2 Face with a Hole

Figure 3.3 PCurve of a Face with one hole

# test pcurve of a face with multi-holes
sphere s 10
mkface s s

pcylinder c1
1 30
pcylinder c2
1 30

ttranslate c1
-5 -5 -15
ttranslate c2
5 5 -15

bop s c1
bopcut s

bop s c2
bopcut s

explode s F
pcurve s_1

av2d
2dfit
fit

Figure 3.4 A sphere face with 4 holes

Figure 3.5 PCurves for a sphere with 4 holes

plane p
trim p p
-10 10 -10 10
mkface p p

ptorus t
5 1

bop p t
bopcut s

vdisplay s

explode s F
pcurve s_1
pcurve s_2

av2d
2dfit
fit

Figure 3.6 A Plane cut a Torus

Figure 3.7 PCurves for the faces

4.Conclusion

5. Acknowledge

6. References

1. Shing Liu. PCurve - Curve on Surface.

2. Shing Liu. Topology and Geometry in OpenCASCADE-Edge.

3. Topology and Geometry in OpenCASCADE-Face.

5. Shing Liu. Delaunay Triangulation in OpenCASCADE.

6. Shing Liu. Triangle-Delaunay Triangulator.

7. OpenCASCADE, Draw Test Harness User Guide.

8. OpenCASCADE, BRep Format White Paper.

9. Richard S. Wright Jr., Benjamin Lipchak. OpenGL SuperBible. Sams Publishing. 2004

10. Dave Shreiner. OpenGL Programming Guide. Addison-Wesley. 2009

eryar
+ 关注

corcosa 14896人浏览