eryar

posts - 534, comments - 590, trackbacks - 0, articles - 0

OpenCASCADE Ring Type Spring Modeling

Abstract. The general method to directly create an edge is to give a 3D curve as the support(geometric domain) of the edge. The curve maybe defined as a 2D curve in the parametric space of a surface: PCurve. When you understand the pcurve, you can modeling some interesting shapes, such as bottle neck thread, helix spring, ring type spring. Etc. The paper is focus on the Ring Type Spring Modeling in OpenCASCADE Draw Test Harness by Tcl script.

Key Words. Spring, Helix, Tcl/Tk, 环形弹簧

1. Introduction

Figure 1.1 Ring Type Spring

2.PCurve

v pcurve是一条二维曲线；

v 与曲面相关；

Figure 2.1 Torus in OpenCASCADE Draw Test Harness

torus t
1 0.3

mkface f t

vdisplay f

http://www.cppblog.com/eryar/archive/2015/07/09/211212.html ，是否可以利用圆环面来生成圆环弹簧呢？实践是检验真理的唯一标准，随便尝试，反正失败了也没有什么损失。要利用pcurve就要找出曲面及其参数空间的一条二维曲线，现在初步确定了曲面为torus面，下面再来寻找pcurve。根据《OpenCASCADE BRep Format》中对于Torus的参数表示方程为：

Figure 2.2 PCurve of Torus Face

Figure 2.3 Torus curves when u=0 and v=0

#
# make helix torus in OpenCASCADE.
# Shing Liu(eryar@163.com)
# 2016-02-20 21:00

# use torus surface.
torus aTorus 10 2

set aSlope
0.05
line aLine2d
0 0 \$aSlope 1
trim aSegment aLine2d
0 2*pi

# make edge by the pcurve.
mkedge aHelixEdge aSegment aTorus 0 2*pi/\$aSlope

# there is no curve 3d in the pcurve edge.
# so need this to approximate one.

mkedgecurve aHelixEdge 0.01

# display the edge.
vdisplay  aHelixEdge

Figure 2.4 Torus Curve made by pcurve

Figure 2.5 Torus Spring

3.Modeling in Draw Test Harness

#
# make helix torus(Ring Type Spring) in OpenCASCADE.
# Shing Liu(eryar@163.com)
# 2016-02-20 21:00
#

# use torus surface.
torus aTorus 10 2

set aSlope
0.05
line aLine2d
0 0 \$aSlope 1
trim aSegment aLine2d
0 2*pi

# make edge by the pcurve.
mkedge aHelixEdge aSegment aTorus 0 2*pi/\$aSlope

# there is no curve 3d in the pcurve edge.
# so need this to approximate one.

mkedgecurve aHelixEdge 0.01

wire aHelixWire aHelixEdge

# make the profile.
circle aProfile 12 0 0 1 1 1 0.3
mkedge aProfile aProfile
wire aProfile aProfile
mkplane aProfile aProfile

# display the profile.
vdisplay aProfile aHelixEdge

# loft the circle along the helix curve.
pipe aSpring aHelixWire aProfile

# display the result.
vdisplay aSpring
#vsetmaterial aSpring steel
vsetgradientbg 180 200 255 180 180 180 2
vsetdispmode
1
vzbufftrihedron

set ray tracing
if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
vtextureenv on
1
}

4. Conclusion

5. References

1. OpenCASCADE BRep Format

2. Shing Liu. Make Helix Curve in OpenCASCADE.

3. ZW3D community topic:

 只有注册用户登录后才能发表评论。 【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库 相关文章: