# No. 272 (Brown 1868): "Rotary motion of the beveled disk cam gives a reciprocating rectilinear motion to the rod bearing on its circumference."
#
# Model (cm, gravity on, the shaft level): a steel disk (radius 6) keyed askew on a horizontal shaft, the one driven joint, 30 turns a minute. Its left face runs
# 1 either way of its mean plane at the rim, and its edge there is beveled at 45 degrees (1.6 deep). A rod, free to slide in two guides up and to the left at 45
# degrees, rests by its own weight with its rounded end (0.4) square on the bevel at the top. As the disk turns, the askew bevel moves 2 x 1 to and fro under it,
# and the rod slides 1.414 up and down its guides, one stroke each way per turn, s = A(1 - cos theta)/sqrt2 up the rod from its lowest. Only the bevel moves the rod.
# Generator: opencode-runs/batch12/gen272.py.
number: 272
slug: beveled-disk-cam-and-rod
name: Beveled disk cam and a sliding rod
brown: "Rotary motion of the beveled disk cam gives a reciprocating rectilinear motion to the rod bearing on its circumference."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 8
  floor: false
bodies:
  - id: cam
    shape: part
    pos: [0, 0, 0]
    density: 7800
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: loft, a: [[-0.5, -0.0, 4.4], [-0.5006, -0.1536, 4.3973], [-0.5024, -0.3069, 4.3893], [-0.5055, -0.4599, 4.3759], [-0.5097, -0.6124, 4.3572], [-0.5152, -0.7641, 4.3332], [-0.5219, -0.9148, 4.3038], [-0.5297, -1.0645, 4.2693], [-0.5387, -1.2128, 4.2296], [-0.5489, -1.3597, 4.1846], [-0.5603, -1.5049, 4.1346], [-0.5728, -1.6483, 4.0796], [-0.5865, -1.7896, 4.0196], [-0.6012, -1.9288, 3.9547], [-0.6171, -2.0657, 3.885], [-0.634, -2.2, 3.8105], [-0.652, -2.3316, 3.7314], [-0.671, -2.4604, 3.6478], [-0.691, -2.5863, 3.5597], [-0.712, -2.7089, 3.4672], [-0.734, -2.8283, 3.3706], [-0.7569, -2.9442, 3.2698], [-0.7807, -3.0565, 3.1651], [-0.8053, -3.1651, 3.0565], [-0.8309, -3.2698, 2.9442], [-0.8572, -3.3706, 2.8283], [-0.8843, -3.4672, 2.7089], [-0.9122, -3.5597, 2.5863], [-0.9408, -3.6478, 2.4604], [-0.9701, -3.7314, 2.3316], [-1.0, -3.8105, 2.2], [-1.0305, -3.885, 2.0657], [-1.0616, -3.9547, 1.9288], [-1.0933, -4.0196, 1.7896], [-1.1254, -4.0796, 1.6483], [-1.158, -4.1346, 1.5049], [-1.191, -4.1846, 1.3597], [-1.2244, -4.2296, 1.2128], [-1.2581, -4.2693, 1.0645], [-1.2921, -4.3038, 0.9148], [-1.3264, -4.3332, 0.7641], [-1.3608, -4.3572, 0.6124], [-1.3955, -4.3759, 0.4599], [-1.4302, -4.3893, 0.3069], [-1.4651, -4.3973, 0.1536], [-1.5, -4.4, 0.0], [-1.5349, -4.3973, -0.1536], [-1.5698, -4.3893, -0.3069], [-1.6045, -4.3759, -0.4599], [-1.6392, -4.3572, -0.6124], [-1.6736, -4.3332, -0.7641], [-1.7079, -4.3038, -0.9148], [-1.7419, -4.2693, -1.0645], [-1.7756, -4.2296, -1.2128], [-1.809, -4.1846, -1.3597], [-1.842, -4.1346, -1.5049], [-1.8746, -4.0796, -1.6483], [-1.9067, -4.0196, -1.7896], [-1.9384, -3.9547, -1.9288], [-1.9695, -3.885, -2.0657], [-2.0, -3.8105, -2.2], [-2.0299, -3.7314, -2.3316], [-2.0592, -3.6478, -2.4604], [-2.0878, -3.5597, -2.5863], [-2.1157, -3.4672, -2.7089], [-2.1428, -3.3706, -2.8283], [-2.1691, -3.2698, -2.9442], [-2.1947, -3.1651, -3.0565], [-2.2193, -3.0565, -3.1651], [-2.2431, -2.9442, -3.2698], [-2.266, -2.8283, -3.3706], [-2.288, -2.7089, -3.4672], [-2.309, -2.5863, -3.5597], [-2.329, -2.4604, -3.6478], [-2.348, -2.3316, -3.7314], [-2.366, -2.2, -3.8105], [-2.3829, -2.0657, -3.885], [-2.3988, -1.9288, -3.9547], [-2.4135, -1.7896, -4.0196], [-2.4272, -1.6483, -4.0796], [-2.4397, -1.5049, -4.1346], [-2.4511, -1.3597, -4.1846], [-2.4613, -1.2128, -4.2296], [-2.4703, -1.0645, -4.2693], [-2.4781, -0.9148, -4.3038], [-2.4848, -0.7641, -4.3332], [-2.4903, -0.6124, -4.3572], [-2.4945, -0.4599, -4.3759], [-2.4976, -0.3069, -4.3893], [-2.4994, -0.1536, -4.3973], [-2.5, -0.0, -4.4], [-2.4994, 0.1536, -4.3973], [-2.4976, 0.3069, -4.3893], [-2.4945, 0.4599, -4.3759], [-2.4903, 0.6124, -4.3572], [-2.4848, 0.7641, -4.3332], [-2.4781, 0.9148, -4.3038], [-2.4703, 1.0645, -4.2693], [-2.4613, 1.2128, -4.2296], [-2.4511, 1.3597, -4.1846], [-2.4397, 1.5049, -4.1346], [-2.4272, 1.6483, -4.0796], [-2.4135, 1.7896, -4.0196], [-2.3988, 1.9288, -3.9547], [-2.3829, 2.0657, -3.885], [-2.366, 2.2, -3.8105], [-2.348, 2.3316, -3.7314], [-2.329, 2.4604, -3.6478], [-2.309, 2.5863, -3.5597], [-2.288, 2.7089, -3.4672], [-2.266, 2.8283, -3.3706], [-2.2431, 2.9442, -3.2698], [-2.2193, 3.0565, -3.1651], [-2.1947, 3.1651, -3.0565], [-2.1691, 3.2698, -2.9442], [-2.1428, 3.3706, -2.8283], [-2.1157, 3.4672, -2.7089], [-2.0878, 3.5597, -2.5863], [-2.0592, 3.6478, -2.4604], [-2.0299, 3.7314, -2.3316], [-2.0, 3.8105, -2.2], [-1.9695, 3.885, -2.0657], [-1.9384, 3.9547, -1.9288], [-1.9067, 4.0196, -1.7896], [-1.8746, 4.0796, -1.6483], [-1.842, 4.1346, -1.5049], [-1.809, 4.1846, -1.3597], [-1.7756, 4.2296, -1.2128], [-1.7419, 4.2693, -1.0645], [-1.7079, 4.3038, -0.9148], [-1.6736, 4.3332, -0.7641], [-1.6392, 4.3572, -0.6124], [-1.6045, 4.3759, -0.4599], [-1.5698, 4.3893, -0.3069], [-1.5349, 4.3973, -0.1536], [-1.5, 4.4, -0.0], [-1.4651, 4.3973, 0.1536], [-1.4302, 4.3893, 0.3069], [-1.3955, 4.3759, 0.4599], [-1.3608, 4.3572, 0.6124], [-1.3264, 4.3332, 0.7641], [-1.2921, 4.3038, 0.9148], [-1.2581, 4.2693, 1.0645], [-1.2244, 4.2296, 1.2128], [-1.191, 4.1846, 1.3597], [-1.158, 4.1346, 1.5049], [-1.1254, 4.0796, 1.6483], [-1.0933, 4.0196, 1.7896], [-1.0616, 3.9547, 1.9288], [-1.0305, 3.885, 2.0657], [-1.0, 3.8105, 2.2], [-0.9701, 3.7314, 2.3316], [-0.9408, 3.6478, 2.4604], [-0.9122, 3.5597, 2.5863], [-0.8843, 3.4672, 2.7089], [-0.8572, 3.3706, 2.8283], [-0.8309, 3.2698, 2.9442], [-0.8053, 3.1651, 3.0565], [-0.7807, 3.0565, 3.1651], [-0.7569, 2.9442, 3.2698], [-0.734, 2.8283, 3.3706], [-0.712, 2.7089, 3.4672], [-0.691, 2.5863, 3.5597], [-0.671, 2.4604, 3.6478], [-0.652, 2.3316, 3.7314], [-0.634, 2.2, 3.8105], [-0.6171, 2.0657, 3.885], [-0.6012, 1.9288, 3.9547], [-0.5865, 1.7896, 4.0196], [-0.5728, 1.6483, 4.0796], [-0.5603, 1.5049, 4.1346], [-0.5489, 1.3597, 4.1846], [-0.5387, 1.2128, 4.2296], [-0.5297, 1.0645, 4.2693], [-0.5219, 0.9148, 4.3038], [-0.5152, 0.7641, 4.3332], [-0.5097, 0.6124, 4.3572], [-0.5055, 0.4599, 4.3759], [-0.5024, 0.3069, 4.3893], [-0.5006, 0.1536, 4.3973]], b: [[1.1, -0.0, 6.0], [1.0994, -0.2094, 5.9963], [1.0976, -0.4185, 5.9854], [1.0945, -0.6272, 5.9671], [1.0903, -0.835, 5.9416], [1.0848, -1.0419, 5.9088], [1.0781, -1.2475, 5.8689], [1.0703, -1.4515, 5.8218], [1.0613, -1.6538, 5.7676], [1.0511, -1.8541, 5.7063], [1.0397, -2.0521, 5.6382], [1.0272, -2.2476, 5.5631], [1.0135, -2.4404, 5.4813], [0.9988, -2.6302, 5.3928], [0.9829, -2.8168, 5.2977], [0.966, -3.0, 5.1962], [0.948, -3.1795, 5.0883], [0.929, -3.3552, 4.9742], [0.909, -3.5267, 4.8541], [0.888, -3.694, 4.7281], [0.866, -3.8567, 4.5963], [0.8431, -4.0148, 4.4589], [0.8193, -4.168, 4.316], [0.7947, -4.316, 4.168], [0.7691, -4.4589, 4.0148], [0.7428, -4.5963, 3.8567], [0.7157, -4.7281, 3.694], [0.6878, -4.8541, 3.5267], [0.6592, -4.9742, 3.3552], [0.6299, -5.0883, 3.1795], [0.6, -5.1962, 3.0], [0.5695, -5.2977, 2.8168], [0.5384, -5.3928, 2.6302], [0.5067, -5.4813, 2.4404], [0.4746, -5.5631, 2.2476], [0.442, -5.6382, 2.0521], [0.409, -5.7063, 1.8541], [0.3756, -5.7676, 1.6538], [0.3419, -5.8218, 1.4515], [0.3079, -5.8689, 1.2475], [0.2736, -5.9088, 1.0419], [0.2392, -5.9416, 0.835], [0.2045, -5.9671, 0.6272], [0.1698, -5.9854, 0.4185], [0.1349, -5.9963, 0.2094], [0.1, -6.0, 0.0], [0.0651, -5.9963, -0.2094], [0.0302, -5.9854, -0.4185], [-0.0045, -5.9671, -0.6272], [-0.0392, -5.9416, -0.835], [-0.0736, -5.9088, -1.0419], [-0.1079, -5.8689, -1.2475], [-0.1419, -5.8218, -1.4515], [-0.1756, -5.7676, -1.6538], [-0.209, -5.7063, -1.8541], [-0.242, -5.6382, -2.0521], [-0.2746, -5.5631, -2.2476], [-0.3067, -5.4813, -2.4404], [-0.3384, -5.3928, -2.6302], [-0.3695, -5.2977, -2.8168], [-0.4, -5.1962, -3.0], [-0.4299, -5.0883, -3.1795], [-0.4592, -4.9742, -3.3552], [-0.4878, -4.8541, -3.5267], [-0.5157, -4.7281, -3.694], [-0.5428, -4.5963, -3.8567], [-0.5691, -4.4589, -4.0148], [-0.5947, -4.316, -4.168], [-0.6193, -4.168, -4.316], [-0.6431, -4.0148, -4.4589], [-0.666, -3.8567, -4.5963], [-0.688, -3.694, -4.7281], [-0.709, -3.5267, -4.8541], [-0.729, -3.3552, -4.9742], [-0.748, -3.1795, -5.0883], [-0.766, -3.0, -5.1962], [-0.7829, -2.8168, -5.2977], [-0.7988, -2.6302, -5.3928], [-0.8135, -2.4404, -5.4813], [-0.8272, -2.2476, -5.5631], [-0.8397, -2.0521, -5.6382], [-0.8511, -1.8541, -5.7063], [-0.8613, -1.6538, -5.7676], [-0.8703, -1.4515, -5.8218], [-0.8781, -1.2475, -5.8689], [-0.8848, -1.0419, -5.9088], [-0.8903, -0.835, -5.9416], [-0.8945, -0.6272, -5.9671], [-0.8976, -0.4185, -5.9854], [-0.8994, -0.2094, -5.9963], [-0.9, -0.0, -6.0], [-0.8994, 0.2094, -5.9963], [-0.8976, 0.4185, -5.9854], [-0.8945, 0.6272, -5.9671], [-0.8903, 0.835, -5.9416], [-0.8848, 1.0419, -5.9088], [-0.8781, 1.2475, -5.8689], [-0.8703, 1.4515, -5.8218], [-0.8613, 1.6538, -5.7676], [-0.8511, 1.8541, -5.7063], [-0.8397, 2.0521, -5.6382], [-0.8272, 2.2476, -5.5631], [-0.8135, 2.4404, -5.4813], [-0.7988, 2.6302, -5.3928], [-0.7829, 2.8168, -5.2977], [-0.766, 3.0, -5.1962], [-0.748, 3.1795, -5.0883], [-0.729, 3.3552, -4.9742], [-0.709, 3.5267, -4.8541], [-0.688, 3.694, -4.7281], [-0.666, 3.8567, -4.5963], [-0.6431, 4.0148, -4.4589], [-0.6193, 4.168, -4.316], [-0.5947, 4.316, -4.168], [-0.5691, 4.4589, -4.0148], [-0.5428, 4.5963, -3.8567], [-0.5157, 4.7281, -3.694], [-0.4878, 4.8541, -3.5267], [-0.4592, 4.9742, -3.3552], [-0.4299, 5.0883, -3.1795], [-0.4, 5.1962, -3.0], [-0.3695, 5.2977, -2.8168], [-0.3384, 5.3928, -2.6302], [-0.3067, 5.4813, -2.4404], [-0.2746, 5.5631, -2.2476], [-0.242, 5.6382, -2.0521], [-0.209, 5.7063, -1.8541], [-0.1756, 5.7676, -1.6538], [-0.1419, 5.8218, -1.4515], [-0.1079, 5.8689, -1.2475], [-0.0736, 5.9088, -1.0419], [-0.0392, 5.9416, -0.835], [-0.0045, 5.9671, -0.6272], [0.0302, 5.9854, -0.4185], [0.0651, 5.9963, -0.2094], [0.1, 6.0, -0.0], [0.1349, 5.9963, 0.2094], [0.1698, 5.9854, 0.4185], [0.2045, 5.9671, 0.6272], [0.2392, 5.9416, 0.835], [0.2736, 5.9088, 1.0419], [0.3079, 5.8689, 1.2475], [0.3419, 5.8218, 1.4515], [0.3756, 5.7676, 1.6538], [0.409, 5.7063, 1.8541], [0.442, 5.6382, 2.0521], [0.4746, 5.5631, 2.2476], [0.5067, 5.4813, 2.4404], [0.5384, 5.3928, 2.6302], [0.5695, 5.2977, 2.8168], [0.6, 5.1962, 3.0], [0.6299, 5.0883, 3.1795], [0.6592, 4.9742, 3.3552], [0.6878, 4.8541, 3.5267], [0.7157, 4.7281, 3.694], [0.7428, 4.5963, 3.8567], [0.7691, 4.4589, 4.0148], [0.7947, 4.316, 4.168], [0.8193, 4.168, 4.316], [0.8431, 4.0148, 4.4589], [0.866, 3.8567, 4.5963], [0.888, 3.694, 4.7281], [0.909, 3.5267, 4.8541], [0.929, 3.3552, 4.9742], [0.948, 3.1795, 5.0883], [0.966, 3.0, 5.1962], [0.9829, 2.8168, 5.2977], [0.9988, 2.6302, 5.3928], [1.0135, 2.4404, 5.4813], [1.0272, 2.2476, 5.5631], [1.0397, 2.0521, 5.6382], [1.0511, 1.8541, 5.7063], [1.0613, 1.6538, 5.7676], [1.0703, 1.4515, 5.8218], [1.0781, 1.2475, 5.8689], [1.0848, 1.0419, 5.9088], [1.0903, 0.835, 5.9416], [1.0945, 0.6272, 5.9671], [1.0976, 0.4185, 5.9854], [1.0994, 0.2094, 5.9963]], collide: 1}   # the bevel
      - {kind: loft, a: [[1.1, -0.0, 6.0], [1.0994, -0.2094, 5.9963], [1.0976, -0.4185, 5.9854], [1.0945, -0.6272, 5.9671], [1.0903, -0.835, 5.9416], [1.0848, -1.0419, 5.9088], [1.0781, -1.2475, 5.8689], [1.0703, -1.4515, 5.8218], [1.0613, -1.6538, 5.7676], [1.0511, -1.8541, 5.7063], [1.0397, -2.0521, 5.6382], [1.0272, -2.2476, 5.5631], [1.0135, -2.4404, 5.4813], [0.9988, -2.6302, 5.3928], [0.9829, -2.8168, 5.2977], [0.966, -3.0, 5.1962], [0.948, -3.1795, 5.0883], [0.929, -3.3552, 4.9742], [0.909, -3.5267, 4.8541], [0.888, -3.694, 4.7281], [0.866, -3.8567, 4.5963], [0.8431, -4.0148, 4.4589], [0.8193, -4.168, 4.316], [0.7947, -4.316, 4.168], [0.7691, -4.4589, 4.0148], [0.7428, -4.5963, 3.8567], [0.7157, -4.7281, 3.694], [0.6878, -4.8541, 3.5267], [0.6592, -4.9742, 3.3552], [0.6299, -5.0883, 3.1795], [0.6, -5.1962, 3.0], [0.5695, -5.2977, 2.8168], [0.5384, -5.3928, 2.6302], [0.5067, -5.4813, 2.4404], [0.4746, -5.5631, 2.2476], [0.442, -5.6382, 2.0521], [0.409, -5.7063, 1.8541], [0.3756, -5.7676, 1.6538], [0.3419, -5.8218, 1.4515], [0.3079, -5.8689, 1.2475], [0.2736, -5.9088, 1.0419], [0.2392, -5.9416, 0.835], [0.2045, -5.9671, 0.6272], [0.1698, -5.9854, 0.4185], [0.1349, -5.9963, 0.2094], [0.1, -6.0, 0.0], [0.0651, -5.9963, -0.2094], [0.0302, -5.9854, -0.4185], [-0.0045, -5.9671, -0.6272], [-0.0392, -5.9416, -0.835], [-0.0736, -5.9088, -1.0419], [-0.1079, -5.8689, -1.2475], [-0.1419, -5.8218, -1.4515], [-0.1756, -5.7676, -1.6538], [-0.209, -5.7063, -1.8541], [-0.242, -5.6382, -2.0521], [-0.2746, -5.5631, -2.2476], [-0.3067, -5.4813, -2.4404], [-0.3384, -5.3928, -2.6302], [-0.3695, -5.2977, -2.8168], [-0.4, -5.1962, -3.0], [-0.4299, -5.0883, -3.1795], [-0.4592, -4.9742, -3.3552], [-0.4878, -4.8541, -3.5267], [-0.5157, -4.7281, -3.694], [-0.5428, -4.5963, -3.8567], [-0.5691, -4.4589, -4.0148], [-0.5947, -4.316, -4.168], [-0.6193, -4.168, -4.316], [-0.6431, -4.0148, -4.4589], [-0.666, -3.8567, -4.5963], [-0.688, -3.694, -4.7281], [-0.709, -3.5267, -4.8541], [-0.729, -3.3552, -4.9742], [-0.748, -3.1795, -5.0883], [-0.766, -3.0, -5.1962], [-0.7829, -2.8168, -5.2977], [-0.7988, -2.6302, -5.3928], [-0.8135, -2.4404, -5.4813], [-0.8272, -2.2476, -5.5631], [-0.8397, -2.0521, -5.6382], [-0.8511, -1.8541, -5.7063], [-0.8613, -1.6538, -5.7676], [-0.8703, -1.4515, -5.8218], [-0.8781, -1.2475, -5.8689], [-0.8848, -1.0419, -5.9088], [-0.8903, -0.835, -5.9416], [-0.8945, -0.6272, -5.9671], [-0.8976, -0.4185, -5.9854], [-0.8994, -0.2094, -5.9963], [-0.9, -0.0, -6.0], [-0.8994, 0.2094, -5.9963], [-0.8976, 0.4185, -5.9854], [-0.8945, 0.6272, -5.9671], [-0.8903, 0.835, -5.9416], [-0.8848, 1.0419, -5.9088], [-0.8781, 1.2475, -5.8689], [-0.8703, 1.4515, -5.8218], [-0.8613, 1.6538, -5.7676], [-0.8511, 1.8541, -5.7063], [-0.8397, 2.0521, -5.6382], [-0.8272, 2.2476, -5.5631], [-0.8135, 2.4404, -5.4813], [-0.7988, 2.6302, -5.3928], [-0.7829, 2.8168, -5.2977], [-0.766, 3.0, -5.1962], [-0.748, 3.1795, -5.0883], [-0.729, 3.3552, -4.9742], [-0.709, 3.5267, -4.8541], [-0.688, 3.694, -4.7281], [-0.666, 3.8567, -4.5963], [-0.6431, 4.0148, -4.4589], [-0.6193, 4.168, -4.316], [-0.5947, 4.316, -4.168], [-0.5691, 4.4589, -4.0148], [-0.5428, 4.5963, -3.8567], [-0.5157, 4.7281, -3.694], [-0.4878, 4.8541, -3.5267], [-0.4592, 4.9742, -3.3552], [-0.4299, 5.0883, -3.1795], [-0.4, 5.1962, -3.0], [-0.3695, 5.2977, -2.8168], [-0.3384, 5.3928, -2.6302], [-0.3067, 5.4813, -2.4404], [-0.2746, 5.5631, -2.2476], [-0.242, 5.6382, -2.0521], [-0.209, 5.7063, -1.8541], [-0.1756, 5.7676, -1.6538], [-0.1419, 5.8218, -1.4515], [-0.1079, 5.8689, -1.2475], [-0.0736, 5.9088, -1.0419], [-0.0392, 5.9416, -0.835], [-0.0045, 5.9671, -0.6272], [0.0302, 5.9854, -0.4185], [0.0651, 5.9963, -0.2094], [0.1, 6.0, -0.0], [0.1349, 5.9963, 0.2094], [0.1698, 5.9854, 0.4185], [0.2045, 5.9671, 0.6272], [0.2392, 5.9416, 0.835], [0.2736, 5.9088, 1.0419], [0.3079, 5.8689, 1.2475], [0.3419, 5.8218, 1.4515], [0.3756, 5.7676, 1.6538], [0.409, 5.7063, 1.8541], [0.442, 5.6382, 2.0521], [0.4746, 5.5631, 2.2476], [0.5067, 5.4813, 2.4404], [0.5384, 5.3928, 2.6302], [0.5695, 5.2977, 2.8168], [0.6, 5.1962, 3.0], [0.6299, 5.0883, 3.1795], [0.6592, 4.9742, 3.3552], [0.6878, 4.8541, 3.5267], [0.7157, 4.7281, 3.694], [0.7428, 4.5963, 3.8567], [0.7691, 4.4589, 4.0148], [0.7947, 4.316, 4.168], [0.8193, 4.168, 4.316], [0.8431, 4.0148, 4.4589], [0.866, 3.8567, 4.5963], [0.888, 3.694, 4.7281], [0.909, 3.5267, 4.8541], [0.929, 3.3552, 4.9742], [0.948, 3.1795, 5.0883], [0.966, 3.0, 5.1962], [0.9829, 2.8168, 5.2977], [0.9988, 2.6302, 5.3928], [1.0135, 2.4404, 5.4813], [1.0272, 2.2476, 5.5631], [1.0397, 2.0521, 5.6382], [1.0511, 1.8541, 5.7063], [1.0613, 1.6538, 5.7676], [1.0703, 1.4515, 5.8218], [1.0781, 1.2475, 5.8689], [1.0848, 1.0419, 5.9088], [1.0903, 0.835, 5.9416], [1.0945, 0.6272, 5.9671], [1.0976, 0.4185, 5.9854], [1.0994, 0.2094, 5.9963]], b: [[2.5, -0.0, 6.0], [2.4994, -0.2094, 5.9963], [2.4976, -0.4185, 5.9854], [2.4945, -0.6272, 5.9671], [2.4903, -0.835, 5.9416], [2.4848, -1.0419, 5.9088], [2.4781, -1.2475, 5.8689], [2.4703, -1.4515, 5.8218], [2.4613, -1.6538, 5.7676], [2.4511, -1.8541, 5.7063], [2.4397, -2.0521, 5.6382], [2.4272, -2.2476, 5.5631], [2.4135, -2.4404, 5.4813], [2.3988, -2.6302, 5.3928], [2.3829, -2.8168, 5.2977], [2.366, -3.0, 5.1962], [2.348, -3.1795, 5.0883], [2.329, -3.3552, 4.9742], [2.309, -3.5267, 4.8541], [2.288, -3.694, 4.7281], [2.266, -3.8567, 4.5963], [2.2431, -4.0148, 4.4589], [2.2193, -4.168, 4.316], [2.1947, -4.316, 4.168], [2.1691, -4.4589, 4.0148], [2.1428, -4.5963, 3.8567], [2.1157, -4.7281, 3.694], [2.0878, -4.8541, 3.5267], [2.0592, -4.9742, 3.3552], [2.0299, -5.0883, 3.1795], [2.0, -5.1962, 3.0], [1.9695, -5.2977, 2.8168], [1.9384, -5.3928, 2.6302], [1.9067, -5.4813, 2.4404], [1.8746, -5.5631, 2.2476], [1.842, -5.6382, 2.0521], [1.809, -5.7063, 1.8541], [1.7756, -5.7676, 1.6538], [1.7419, -5.8218, 1.4515], [1.7079, -5.8689, 1.2475], [1.6736, -5.9088, 1.0419], [1.6392, -5.9416, 0.835], [1.6045, -5.9671, 0.6272], [1.5698, -5.9854, 0.4185], [1.5349, -5.9963, 0.2094], [1.5, -6.0, 0.0], [1.4651, -5.9963, -0.2094], [1.4302, -5.9854, -0.4185], [1.3955, -5.9671, -0.6272], [1.3608, -5.9416, -0.835], [1.3264, -5.9088, -1.0419], [1.2921, -5.8689, -1.2475], [1.2581, -5.8218, -1.4515], [1.2244, -5.7676, -1.6538], [1.191, -5.7063, -1.8541], [1.158, -5.6382, -2.0521], [1.1254, -5.5631, -2.2476], [1.0933, -5.4813, -2.4404], [1.0616, -5.3928, -2.6302], [1.0305, -5.2977, -2.8168], [1.0, -5.1962, -3.0], [0.9701, -5.0883, -3.1795], [0.9408, -4.9742, -3.3552], [0.9122, -4.8541, -3.5267], [0.8843, -4.7281, -3.694], [0.8572, -4.5963, -3.8567], [0.8309, -4.4589, -4.0148], [0.8053, -4.316, -4.168], [0.7807, -4.168, -4.316], [0.7569, -4.0148, -4.4589], [0.734, -3.8567, -4.5963], [0.712, -3.694, -4.7281], [0.691, -3.5267, -4.8541], [0.671, -3.3552, -4.9742], [0.652, -3.1795, -5.0883], [0.634, -3.0, -5.1962], [0.6171, -2.8168, -5.2977], [0.6012, -2.6302, -5.3928], [0.5865, -2.4404, -5.4813], [0.5728, -2.2476, -5.5631], [0.5603, -2.0521, -5.6382], [0.5489, -1.8541, -5.7063], [0.5387, -1.6538, -5.7676], [0.5297, -1.4515, -5.8218], [0.5219, -1.2475, -5.8689], [0.5152, -1.0419, -5.9088], [0.5097, -0.835, -5.9416], [0.5055, -0.6272, -5.9671], [0.5024, -0.4185, -5.9854], [0.5006, -0.2094, -5.9963], [0.5, -0.0, -6.0], [0.5006, 0.2094, -5.9963], [0.5024, 0.4185, -5.9854], [0.5055, 0.6272, -5.9671], [0.5097, 0.835, -5.9416], [0.5152, 1.0419, -5.9088], [0.5219, 1.2475, -5.8689], [0.5297, 1.4515, -5.8218], [0.5387, 1.6538, -5.7676], [0.5489, 1.8541, -5.7063], [0.5603, 2.0521, -5.6382], [0.5728, 2.2476, -5.5631], [0.5865, 2.4404, -5.4813], [0.6012, 2.6302, -5.3928], [0.6171, 2.8168, -5.2977], [0.634, 3.0, -5.1962], [0.652, 3.1795, -5.0883], [0.671, 3.3552, -4.9742], [0.691, 3.5267, -4.8541], [0.712, 3.694, -4.7281], [0.734, 3.8567, -4.5963], [0.7569, 4.0148, -4.4589], [0.7807, 4.168, -4.316], [0.8053, 4.316, -4.168], [0.8309, 4.4589, -4.0148], [0.8572, 4.5963, -3.8567], [0.8843, 4.7281, -3.694], [0.9122, 4.8541, -3.5267], [0.9408, 4.9742, -3.3552], [0.9701, 5.0883, -3.1795], [1.0, 5.1962, -3.0], [1.0305, 5.2977, -2.8168], [1.0616, 5.3928, -2.6302], [1.0933, 5.4813, -2.4404], [1.1254, 5.5631, -2.2476], [1.158, 5.6382, -2.0521], [1.191, 5.7063, -1.8541], [1.2244, 5.7676, -1.6538], [1.2581, 5.8218, -1.4515], [1.2921, 5.8689, -1.2475], [1.3264, 5.9088, -1.0419], [1.3608, 5.9416, -0.835], [1.3955, 5.9671, -0.6272], [1.4302, 5.9854, -0.4185], [1.4651, 5.9963, -0.2094], [1.5, 6.0, -0.0], [1.5349, 5.9963, 0.2094], [1.5698, 5.9854, 0.4185], [1.6045, 5.9671, 0.6272], [1.6392, 5.9416, 0.835], [1.6736, 5.9088, 1.0419], [1.7079, 5.8689, 1.2475], [1.7419, 5.8218, 1.4515], [1.7756, 5.7676, 1.6538], [1.809, 5.7063, 1.8541], [1.842, 5.6382, 2.0521], [1.8746, 5.5631, 2.2476], [1.9067, 5.4813, 2.4404], [1.9384, 5.3928, 2.6302], [1.9695, 5.2977, 2.8168], [2.0, 5.1962, 3.0], [2.0299, 5.0883, 3.1795], [2.0592, 4.9742, 3.3552], [2.0878, 4.8541, 3.5267], [2.1157, 4.7281, 3.694], [2.1428, 4.5963, 3.8567], [2.1691, 4.4589, 4.0148], [2.1947, 4.316, 4.168], [2.2193, 4.168, 4.316], [2.2431, 4.0148, 4.4589], [2.266, 3.8567, 4.5963], [2.288, 3.694, 4.7281], [2.309, 3.5267, 4.8541], [2.329, 3.3552, 4.9742], [2.348, 3.1795, 5.0883], [2.366, 3.0, 5.1962], [2.3829, 2.8168, 5.2977], [2.3988, 2.6302, 5.3928], [2.4135, 2.4404, 5.4813], [2.4272, 2.2476, 5.5631], [2.4397, 2.0521, 5.6382], [2.4511, 1.8541, 5.7063], [2.4613, 1.6538, 5.7676], [2.4703, 1.4515, 5.8218], [2.4781, 1.2475, 5.8689], [2.4848, 1.0419, 5.9088], [2.4903, 0.835, 5.9416], [2.4945, 0.6272, 5.9671], [2.4976, 0.4185, 5.9854], [2.4994, 0.2094, 5.9963]], collide: 0}   # the rim and the disk's body
      - {kind: rod, from: [1.5, 0, 0], to: [3.1, 0, 0], radius: 1.3, collide: 0, color: "#b8ad97"}   # the hub
      - {kind: rod, from: [-11, 0, 0], to: [11, 0, 0], radius: 0.45, collide: 0, color: "#8f8a80"}   # the shaft
  - id: rod
    shape: part
    pos: [-0.4828, 0, 4.9828]
    density: 7800
    friction: 0.1
    color: "#d9cdb0"
    pieces:
      - {kind: rod, from: [-0.4828, 0, 4.9828], to: [-9.6752, 0, 14.1752], radius: 0.4, capsule: true, collide: 2}   # the rod, its end rounded
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [-3.6648, 0, 8.1648], to: [-4.3719, 0, 8.8719], radius: 0.75, collide: 0}   # the rod's guides
      - {kind: rod, from: [-7.5539, 0, 12.0539], to: [-8.261, 0, 12.761], radius: 0.75, collide: 0}
      - {kind: rod, from: [-10.5, 0, 0], to: [-8.5, 0, 0], radius: 0.9, collide: 0}   # the shaft's bearings
      - {kind: rod, from: [8.5, 0, 0], to: [10.5, 0, 0], radius: 0.9, collide: 0}
joints:
  - {id: j_d, type: hinge, body: cam, axis: [1, 0, 0], damping: 0.001}   # the one driven joint
  - {id: j_s, type: slide, body: rod, axis: [-0.7071, 0, 0.7071], range: [-3, 1.5], damping: 0.3}   # the rod in its guides; + : up and to the left
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_d, kind: velocity, rpm: 30, kv: 5.0, max_torque: 5.0}
checks:
  - {type: amplitude, joint: j_s, min: 0.0067, max: 0.0074, sustain: 0.95, settle_s: 1.0, window_s: 6.5}   # half the stroke, A/sqrt2
  - {type: position, joint: j_s, min: -0.1, max: 1.5142, settle_s: 0.5, window_s: 7.0}   # within the stroke: the rod never jumps off the bevel
  - {type: advance, joint: j_d, beat: j_s, expect: 3.1416, tol: 0.03, settle_s: 1.0, window_s: 6.5}   # one stroke each way per turn of the disk
  - {type: penetration, max: 0.0005, settle_s: 0.5}
camera: {target: [-2.0, 0, 1.0], position: [-30.0, -70.0, 14.0], fov: 34.0}
display:
  output: j_s
  labels: {j_d: "The disk cam (driver)", j_s: "The rod"}
  proof: {label: "Beveled disk cam", sub: "the askew bevel slides the rod to and fro"}

