summaryrefslogtreecommitdiff
path: root/src/helpers_cadquery.py
diff options
context:
space:
mode:
authorJoshua Shreve <j.a.shreve@gmail.com>2021-07-29 21:07:35 -0400
committerJoshua Shreve <j.a.shreve@gmail.com>2021-07-29 21:07:35 -0400
commit8409bdb6187a6d6e7def10b7fe7bded18e546e43 (patch)
tree60ca216a1c55d64939f10b4a105c371c559f00aa /src/helpers_cadquery.py
parent7bebd909e1f02ed08b02ba06de30dd53e77c4b6d (diff)
Fixed keyswitch nubs. Error came from code consolidation between cadquery and solid python. One centered the cylinder, the other generated it in the positive Z direction. Both now fully center the cylinder and the two models generate consistently.
Diffstat (limited to 'src/helpers_cadquery.py')
-rw-r--r--src/helpers_cadquery.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/helpers_cadquery.py b/src/helpers_cadquery.py
index 44553e6..5fb3886 100644
--- a/src/helpers_cadquery.py
+++ b/src/helpers_cadquery.py
@@ -15,7 +15,9 @@ def box(width, height, depth):
def cylinder(radius, height, segments=100):
- return cq.Workplane("XY").union(cq.Solid.makeCylinder(radius=radius, height=height))
+ shape = cq.Workplane("XY").union(cq.Solid.makeCylinder(radius=radius, height=height))
+ shape = translate(shape, (0, 0, -height/2))
+ return shape
def sphere(radius):