-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
committed
Jan 19, 2021
1 parent
039952c
commit e483b04
Showing
1 changed file
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import cadquery as cq | ||
|
||
r = 0.5 # Radius of the helix | ||
p = 0.4 # Pitch of the helix - vertical distance between loops | ||
h = 2.4 # Height of the helix - total height | ||
r = 0.5 # Radius of the helix | ||
p = 0.4 # Pitch of the helix - vertical distance between loops | ||
h = 2.4 # Height of the helix - total height | ||
|
||
# Helix | ||
wire = cq.Wire.makeHelix(pitch=p, height=h, radius=r) | ||
helix = cq.Workplane(obj=wire) | ||
|
||
# Final result: A 2D shape swept along a helix. | ||
result = ( | ||
cq.Workplane('XZ') # helix is moving up the Z axis | ||
.center(r, 0) # offset isosceles trapezoid | ||
.polyline(((-.15,0.1), (0.0,0.05), (0,0.35), (-0.15,0.3))) | ||
.close() # make edges a wire | ||
.sweep(helix, isFrenet=True) # Frenet keeps orientation as expected | ||
cq.Workplane("XZ") # helix is moving up the Z axis | ||
.center(r, 0) # offset isosceles trapezoid | ||
.polyline(((-0.15, 0.1), (0.0, 0.05), (0, 0.35), (-0.15, 0.3))) | ||
.close() # make edges a wire | ||
.sweep(helix, isFrenet=True) # Frenet keeps orientation as expected | ||
) | ||
|
||
show_object(result) |