Flex holds up

This commit is contained in:
Matthias Neeracher 2022-02-19 21:16:46 +01:00
parent 33e8a83404
commit 4c8ca5db03

View File

@ -20,7 +20,7 @@ parser.add_argument('--extra-height', default=2.0, type=float, help='Extra verti
parser.add_argument('--thickness', default=3.0, type=float, help='Thickness of material') parser.add_argument('--thickness', default=3.0, type=float, help='Thickness of material')
parser.add_argument('--lid', default=0.2, type=float, help='How much extra play to give the lid') parser.add_argument('--lid', default=0.2, type=float, help='How much extra play to give the lid')
parser.add_argument('--tooth', default=0.8, type=float, help='How much to round the edges of the teeth') parser.add_argument('--tooth', default=0.8, type=float, help='How much to round the edges of the teeth')
parser.add_argument('--flex-granularity', default=1.7, type=float, help='How much space to give a pair of flex lines') parser.add_argument('--flex-granularity', default=1.8, type=float, help='How much space to give a pair of flex lines')
parser.add_argument('--verbose', action='store_true', help='Print computed parameter values') parser.add_argument('--verbose', action='store_true', help='Print computed parameter values')
args = parser.parse_args() args = parser.parse_args()
assert (args.dimension % 2) == 1 assert (args.dimension % 2) == 1
@ -60,15 +60,15 @@ args.exterior_leg = (finger_length-(2*args.n_hor_fingers-1)*args.horizontal_fin
args.wall_leg = (args.interior_edge-args.corner-(2*args.n_hor_fingers-1)*args.horizontal_finger+args.kerf)/2 args.wall_leg = (args.interior_edge-args.corner-(2*args.n_hor_fingers-1)*args.horizontal_finger+args.kerf)/2
args.exterior_slot = (args.interior_edge-args.horizontal_finger+args.kerf)/2 args.exterior_slot = (args.interior_edge-args.horizontal_finger+args.kerf)/2
args.n_ver_fingers = int((args.height+args.extra_height)/args.vertical_finger) args.n_ver_fingers = int((args.height+args.extra_height)/args.vertical_finger)
top_slot = args.extra_height+0.5*args.height top_slot = args.extra_height+args.thickness+0.5*args.height
args.slots = [top_slot, top_slot+2*args.thickness] args.slots = [top_slot, top_slot+10.0]
if args.verbose: if args.verbose:
print(args, file=sys.stderr) print(args, file=sys.stderr)
BOX = 2.0*args.exterior_edge+5.0 BOX = 2.0*args.exterior_edge+5.0
DIMX = 3.0*BOX DIMX = 3.0*BOX
DIMY = 2.0*BOX+args.height+args.extra_height+2.0*args.thickness+5.0 DIMY = 2.0*BOX+args.height+args.extra_height+3.0*args.thickness+5.0
PI3 = math.pi/3 PI3 = math.pi/3
HOLES = '' HOLES = ''
@ -295,6 +295,6 @@ draw_plane(1.5*BOX, 1.5*BOX, 'rim')
draw_plane(1.5*BOX, 1.5*BOX, 'plug') draw_plane(1.5*BOX, 1.5*BOX, 'plug')
draw_plane(2.5*BOX, 1.5*BOX, 'lid') draw_plane(2.5*BOX, 1.5*BOX, 'lid')
draw_plane(2.5*BOX, 1.5*BOX, 'plug_mark') draw_plane(2.5*BOX, 1.5*BOX, 'plug_mark')
draw_case(0.05*args.grid*args.dimension, 2.0*BOX, args.height+args.extra_height, args.slots) draw_case(0.05*args.grid*args.dimension, 2.0*BOX, args.height+args.extra_height+args.thickness, args.slots)
print('<g fill="none" stroke="red">', HOLES, '</g>', '<g fill="none" stroke="blue">', MARKS, '</g>', '<g fill="none" stroke="black">', SHAPES, '</g>', sep='\n') print('<g fill="none" stroke="black">', SHAPES, '</g>', '<g fill="none" stroke="red">', HOLES, '</g>', '<g fill="none" stroke="blue">', MARKS, '</g>', sep='\n')
print('</svg>') print('</svg>')