aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-06-30 09:20:38 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2014-06-30 09:20:38 +0200
commitb59201fcce83eb62c9202fcc6f3e2c4e26f02c5b (patch)
tree7f450c7d79aab8baa9c97541358fde9a84d1a743
parenta4d8a39b4c68f1f52cd897dd94787685d02c8c86 (diff)
downloadchimaera_mplek-b59201fcce83eb62c9202fcc6f3e2c4e26f02c5b.zip
chimaera_mplek-b59201fcce83eb62c9202fcc6f3e2c4e26f02c5b.tar.gz
chimaera_mplek-b59201fcce83eb62c9202fcc6f3e2c4e26f02c5b.tar.bz2
chimaera_mplek-b59201fcce83eb62c9202fcc6f3e2c4e26f02c5b.tar.xz
update design with embedded magnet
-rw-r--r--Makefile12
-rw-r--r--mplek.py27
2 files changed, 27 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 5907791..50223c9 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,18 @@ TARGETS += mplek_19.0mm.stl
TARGETS += mplek_19.5mm.stl
TARGETS += mplek_20.0mm.stl
TARGETS += mplek_20.5mm.stl
+TARGETS += mplek_21.0mm.stl
+TARGETS += mplek_21.5mm.stl
+TARGETS += mplek_22.0mm.stl
+TARGETS += mplek_22.5mm.stl
+TARGETS += mplek_23.0mm.stl
+TARGETS += mplek_23.5mm.stl
+TARGETS += mplek_24.0mm.stl
+TARGETS += mplek_24.5mm.stl
+TARGETS += mplek_25.0mm.stl
+TARGETS += mplek_25.5mm.stl
+TARGETS += mplek_26.0mm.stl
+TARGETS += mplek_26.5mm.stl
all: $(TARGETS)
diff --git a/mplek.py b/mplek.py
index 84bdee2..a1a8170 100644
--- a/mplek.py
+++ b/mplek.py
@@ -14,15 +14,18 @@ from math import pi, sin, cos
D = float(sys.argv[4]) # diameter of 2nd phalanx
T = 1 # wall thickness
-N = 8 # number of edges of polygonal prism
+B = 1 # bevel thickness
+N = 12 # number of edges of polygonal prism
P = pi/N # edge angle of polygonal prism
+prec = 1.01
+
W = 4 # width of bar magnet
H = 3 # height of bar magnet
L = 20 # length of bar magnet
R0 = D/2 # radius of 2nd phalanx
-R1 = R0+T+H/2 # minimal radius of polygonal prism
+R1 = R0+1.5*T+H/2 # minimal radius of polygonal prism
R2 = R1/cos(P) # maximal radius of polygonal prism
C = 6 # diameter of circular magnet
@@ -35,18 +38,18 @@ for item in bpy.data.objects:
bpy.ops.object.delete()
# create inner cyclinder, aka virtual finger
-bpy.ops.mesh.primitive_cylinder_add(vertices=64, radius=R0, depth=L, location=cen)
+bpy.ops.mesh.primitive_cylinder_add(vertices=64, radius=R0, depth=L, location=(-(H+T)/2,0,0))
inner = bpy.context.active_object
inner.name = "inner"
# create bar magnet
-bpy.ops.mesh.primitive_cube_add(location=(R1, 0, 0))
+bpy.ops.mesh.primitive_cube_add(location=(R1-T-H/2, 0, 0))
bar = bpy.context.active_object
bar.name = "bar"
-bpy.ops.transform.resize(value=(H/2, W/2, L/2))
+bpy.ops.transform.resize(value=(H/2*prec, W/2*prec, L/2*prec))
# create cylinder magnet
-bpy.ops.mesh.primitive_cylinder_add(vertices=64, radius=C/2, depth=T*3, location=(R1-T*1.5-H/2, 0, 0), rotation=(0,pi/2,0))
+bpy.ops.mesh.primitive_cylinder_add(vertices=64, radius=C/2*prec, depth=T*2, location=(R1-T*2-H, 0, 0), rotation=(0,pi/2,0))
cyl = bpy.context.active_object
cyl.name = "cyl"
cyl.select = False
@@ -89,14 +92,14 @@ outer.select = True
bpy.ops.object.modifier_add(type="BEVEL")
bevel = outer.modifiers["Bevel"]
bevel.name = "bevel"
-bevel.width = T
+bevel.width = B
bevel.segments = 1
-# add simple deform modifier
-bpy.ops.object.modifier_add(type="SIMPLE_DEFORM")
-simple = outer.modifiers["SimpleDeform"]
-simple.name = "simple"
-simple.angle = P
+## add simple deform modifier
+#bpy.ops.object.modifier_add(type="SIMPLE_DEFORM")
+#simple = outer.modifiers["SimpleDeform"]
+#simple.name = "simple"
+#simple.angle = P
# subtract inner from outer cylinder
bpy.ops.object.modifier_add(type="BOOLEAN")