Flex (barely) holds up

This commit is contained in:
Matthias Neeracher 2021-11-26 04:51:34 +01:00
parent 2f9c97913e
commit 33e8a83404

View File

@ -20,6 +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('--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
@ -179,7 +180,7 @@ def draw_flex(t, h):
turtle = svgturtle.SvgTurtle(t.x, t.y) turtle = svgturtle.SvgTurtle(t.x, t.y)
al = h/3.0-args.thickness al = h/3.0-args.thickness
bl = (h-args.thickness)/3.0-args.thickness bl = (h-args.thickness)/3.0-args.thickness
nx = int(args.corner/1.5) nx = int(args.corner/args.flex_granularity)
dx = args.corner/(2*nx-1) dx = args.corner/(2*nx-1)
for stripe in range(nx): for stripe in range(nx):
turtle.right(90) turtle.right(90)
@ -295,5 +296,5 @@ 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.slots)
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('<g fill="none" stroke="red">', HOLES, '</g>', '<g fill="none" stroke="blue">', MARKS, '</g>', '<g fill="none" stroke="black">', SHAPES, '</g>', sep='\n')
print('</svg>') print('</svg>')