扫掠体函数

示例1:

# 描述截面
testsection = Section(Vec3(100,-100,0), scale(100) * Arc(0.5*pi), Vec3(-100,100,0), Vec3(-100,-100,0))
# 描述轨迹
testline = Line(Vec3(0,0,0), Vec3(500,500,500))
# 扫略
testsweep = Sweep(testsection, testline)

Sweep中需要装填截面和截面路径两个参数
其中,如上文所讲,截面可以装填点(Vec3),线(Line)和弧(Arc)。
界面路径,也是扫掠轨迹,可以装填线(Line)和弧(Arc)。

示例2:

r = 90
sectionOut = translation(200,0,0) * rotate(Vec3(1,0,0), 0.5*pi) * Section(Vec2(0,0), Vec2(100,0), Vec2(100,100), Vec2(0,100))
section_1 = translation(200,0,0) * rotate(Vec3(1,0,0), 0.5*pi) * Section(Vec2(80,80), Vec2(60,80), Vec2(60,60), Vec2(80,60))
section_2 = translation(200,0,0) * rotate(Vec3(1,0,0), 0.5*pi) * Section(Vec2(50,50), Vec2(20,50), Vec2(20,20), Vec2(50,20))
line = Line(Arc(r*pi/180))
sweep = Sweep(sectionOut - section_1 - section_2 , line) 

需要注意,Sweep中装填的Line,只能为一段圆弧和一个两点组成的直线段,不能装填多段线,不能装填线、弧结合的Line。
同时,装填Arc时,仅表示截面的旋转角度,不表示截面运动的弧线轨迹。因此请先将截面根据半径移动后,再进行Sweep。