forked from tazjel/declaracad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sweeps.enaml
43 lines (37 loc) · 1.12 KB
/
sweeps.enaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import math
from enaml.core.api import Looper
from declaracad.occ.api import (
Transform, Revol, Face, Segment, Wire, Point, Part
)
enamldef Bit(Transform): bit:
attr length = 30 # Todo
attr width = 10
alias angle: revol.angle
attr points << [
(0,0,0),
(0,bit.width,0),
(0,bit.width,bit.length),
(0,bit.width/2.0,bit.length-bit.length/4.0),
(0,bit.width/2.0,bit.length-bit.length/2.0),
(0,0,bit.length/4.0),
(0,0,0)
]
Revol: revol:
#: Axis of rotation
position << (0,bit.width,0)
Face:
#: Face similar to https://www.opencascade.com/doc/occt-7.0.0/overview/html/occt_user_guides__modeling_algos.html
Wire:
Segment:
Looper:
iterable << bit.points
Point:
position << loop_item
enamldef Assembly(Part):
name = "Sweeps"
Bit:
pass
Bit:
length = 40
translate = (-10,-10,0)
angle = math.pi/3