66 lines
1.6 KiB
Python
66 lines
1.6 KiB
Python
"""Prototype model for scooby tag."""
|
|
|
|
import solid2 as sp
|
|
|
|
TAG_DEPTH = 25.00
|
|
|
|
BONE_CORE_WIDTH = 55.00
|
|
BONE_CORE_HEIGHT = 45.00
|
|
BONE_JOINT_R = 18.00
|
|
BONE_JOINT_DIST_RATIO = .6
|
|
|
|
DISP_OUT_HEIGHT = 31.80
|
|
DISP_OUT_WIDTH = 37.32
|
|
DISP_VIS_HEIGHT = 28.40
|
|
DISP_VIS_WIDTH = 28.40
|
|
DISP_VIS_THICK = 1.00
|
|
DISP_THICK = 1.00
|
|
|
|
SEP_THICK = 3.00
|
|
|
|
MICRO_DEPTH = 16.00
|
|
MICRO_WIDTH = 47.00
|
|
MICRO_HEIGHT = 23.00
|
|
|
|
XX = .2
|
|
|
|
def gen_bone() -> sp.OpenSCADObjectPlus:
|
|
core = sp.up(TAG_DEPTH/2)(sp.cube([BONE_CORE_WIDTH, BONE_CORE_HEIGHT, TAG_DEPTH], center=True))
|
|
|
|
joint = sp.cylinder(TAG_DEPTH, r=BONE_JOINT_R, center=False)
|
|
joint2 = sp.union()(
|
|
sp.forward(+BONE_JOINT_R*BONE_JOINT_DIST_RATIO)(joint),
|
|
sp.forward(-BONE_JOINT_R*BONE_JOINT_DIST_RATIO)(joint),
|
|
)
|
|
joint_l = sp.left(BONE_CORE_WIDTH/2)(joint2)
|
|
joint_r = sp.right(BONE_CORE_WIDTH/2)(joint2)
|
|
|
|
bone = sp.union()(
|
|
core,
|
|
joint_l,
|
|
joint_r,
|
|
)
|
|
return bone
|
|
|
|
def gen_display_mask() -> sp.OpenSCADObjectPlus:
|
|
visible = sp.up(DISP_VIS_THICK/2)(sp.cube([DISP_VIS_WIDTH, DISP_VIS_HEIGHT, DISP_VIS_THICK+XX], center=True))
|
|
visible = sp.up(DISP_THICK)(visible)
|
|
fit = sp.up(DISP_THICK/2)(sp.cube([DISP_OUT_WIDTH, DISP_OUT_HEIGHT, DISP_THICK], center=True))
|
|
fit = sp.left((DISP_OUT_WIDTH-DISP_VIS_WIDTH)/2)(fit)
|
|
mask = sp.union()(visible, fit)
|
|
mask = sp.forward((DISP_OUT_HEIGHT-DISP_VIS_HEIGHT)/4)(mask)
|
|
return mask
|
|
|
|
def gen_tag() -> sp.OpenSCADObjectPlus:
|
|
bone = gen_bone()
|
|
|
|
positive = sp.union()(
|
|
bone
|
|
)
|
|
|
|
mask = gen_display_mask()
|
|
mask = sp.up(TAG_DEPTH-DISP_THICK-DISP_VIS_THICK)(mask)
|
|
|
|
final = positive - mask
|
|
return final
|