eryar

posts - 403, comments - 568, trackbacks - 0, articles - 0

OpenCascade Sweep Algorithm

eryar@163.com

Abstract. Sweeps are the objects you obtain by sweeping a profile along a path. Sweep is a very useful modeling algorithm. The paper focus on the introduction of the sweep algorithms in the opencascade.

Key Words. Sweep, Prism, Revol, Pipe, Frenet Trihedron,

1. Introduction

Figure 1. Generating a sweep

l BRepPrimAPI_MakePrism：生成线性扫掠；

l BRepPrimAPI_MakeRevol：生成旋转扫掠；

l BRepOffsetAPI_MakePipeShell： 生成通用的扫掠；

2.Prism

```polyline p  0 0 0 1 0 0 1 2 0 0 1 0 0 0 0
prism r p 0 0 1
vdisplay p r```

3.Revol

```polyline p  0 0 0 1 0 0 1 2 0 0 1 0 0 0 0
revol r p 3 0 0 0 1 0 280
vdisplay p r```

4.Pipe Shell

l mksweep

l addsweep

l deletesweep

l sestsweep

l buildsweep

```setsweep options [arg1 [arg2 [...]]] : options are :
-FR : Tangent and Normal are given by Frenet trihedron
-CF : Tangente is given by Frenet, the Normal is computed to minimize the torsion
-DT : discrete trihedron
-DX Surf : Tangent and Normal are given by Darboux trihedron,
Surf have to be a shell or a face
-CN dx dy dz : BiNormal is given by dx dy dz
-FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed
-G guide  0|1(Plan|ACR)  0|1|2(no contact|contact|contact on border) : with guide```

-FR选项：切矢和法向由Frenet标架确定；

-CF选项：切矢由Frenet标架指定，法向通过计算最小扭转来确定；

-DT选项：切矢和法向由Darboux标架确定；

-CN选项：副法向由指定的dx, dy, dz确定；

-FT：切矢和法向是固定的；

```polyline p  0 0 0 1 0 0 1 2 0 0 1 0
circle c 0 0 0 1 0 0 0.2
mkedge e c
wire w e
mksweep p
addsweep w
setsweep -FX 1 0 0
buildsweep r -C
vdisplay p w r```

```mksweep p
addsweep w
setsweep -FR
buildsweep r -C
vdisplay p w r```

```buildsweep result [-M/-C/-R] [-S] [tol] : options are
-M : Discontinuities are treated by Modfication of
the sweeping mode : it is the default
-C : Discontinuities are treated like Right Corner
Treatement is Extent && Intersect
-R : Discontinuities are treated like Round Corner
Treatement is Intersect and Fill
-S : To build a Solid```

buildsweep有指定不连续的处理方式及是否生成实体。其中

n -C：将路径Path中不连续的地方通过延长和相交进行处理；

n -R：将路径Path中不连续的地方通过相交和填充进行处理；

```polyline p  0 0 0 1 0 0 1 2 0 0 1 0 0 0 0
circle c 0 0 0 1 0 0 0.2
mkedge e c
wire w e
mksweep p
addsweep w
buildsweep r -C
vdisplay p w r```

`buildsweep r -R`

5.Conclusion

OpenCASCADE提供了扫掠造型的算法。对于扫掠造型的两个特例Prism和Revol，提供了类BrepPrimAPI_MakePrism和BRepPrimAPI_MakeRevol来分别生成拉伸体和和旋转体。

6.References

1. OpenCASCADE Modeling Algorithms.

2. 詹海生. 李光鑫. 马志欣. 基于ACIS的几何造型技术与系统开发. 清华大学出版社. 2002

3. 陈维桓. 微分几何. 北京大学出版社.

为了方便大家在移动端也能看到我的博文和讨论交流，现已注册微信公众号，欢迎大家扫描下方二维码关注。

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