Skip to content

Commit

Permalink
remove clean
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinSDK committed Nov 23, 2021
1 parent 23f655e commit 4287cd4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/torus_knot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def torus_knot(p, q):
),
auxSpine = Workplane().rect(1, 1)
)
).clean()

)
p = 3
q = 2

Expand Down
25 changes: 25 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from cqmore import Workplane
from cqmore.curve import torusKnot, parametricEquation
from cqmore.polygon import star

from cadquery import Plane, Vector

def torus_knot(p, q):
origin = torusKnot(0, p = p, q = q)
v1 = Vector(*torusKnot(0.9, p = p, q = q))
v2 = Vector(*torusKnot(0.1, p = p, q = q))

return (Workplane(Plane(origin = origin, normal=(v2 - v1)))
.makePolygon([(p[0] * 0.5, p[1] * 0.5) for p in star()])
.sweep(
Workplane().parametricCurve(
parametricEquation(torusKnot, p = p, q = q)
),
auxSpine = Workplane().rect(1, 1)
)
).clean()

p = 3
q = 2

knot = torus_knot(p, q)

0 comments on commit 4287cd4

Please sign in to comment.