- Notifications
You must be signed in to change notification settings - Fork 322
/
Copy pathEx018_Making_Lofts.py
25 lines (23 loc) · 937 Bytes
/
Ex018_Making_Lofts.py
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
importcadqueryascq
# Create a lofted section between a rectangle and a circular section.
# 1. Establishes a workplane that an object can be built on.
# 1a. Uses the named plane orientation "front" to define the workplane, meaning
# that the positive Z direction is "up", and the negative Z direction
# is "down".
# 2. Creates a plain box to base future geometry on with the box() function.
# 3. Selects the top-most Z face of the box.
# 4. Draws a 2D circle at the center of the the top-most face of the box.
# 5. Creates a workplane 3 mm above the face the circle was drawn on.
# 6. Draws a 2D circle on the new, offset workplane.
# 7. Creates a loft between the circle and the rectangle.
result= (
cq.Workplane("front")
.box(4.0, 4.0, 0.25)
.faces(">Z")
.circle(1.5)
.workplane(offset=3.0)
.rect(0.75, 0.5)
.loft(combine=True)
)
# Displays the result of this script
show_object(result)