{"id":"0001_00011549","images":["images/0001_00011549.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 35.79 mm tall. It is extruded to a thickness of 22.92 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.195444067796607\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(182.574403, 159.089968), (182.574403, 116.305654), (63.029996, 116.305654), (63.029996, 159.089968), (182.574403, 159.089968)], [(182.574403, 74.910061), (182.574403, 102.305654), (63.029996, 102.305654)], [(63.029996, 74.910061), (63.029996, 102.305654)], [(182.574403, 74.910061), (63.029996, 74.910061)], [(196.574403, 116.305654), (223.969996, 116.305654), (223.969996, 159.089968)], [(196.574403, 159.089968), (223.969996, 159.089968)], [(196.574403, 116.305654), (196.574403, 159.089968)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (182.5744, 159.0899), (63.03, 159.0899), (122.8022, 148.0899)), ('vertical', '35.7895', (182.5744, 116.3057), (182.5744, 159.0899), (171.5744, 137.6978)), ('horizontal', '22.9167', (196.5744, 116.3057), (223.97, 116.3057), (210.2722, 127.3057))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0001_00011549_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0003_00035378","images":["images/0003_00035378.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 47.37 mm tall. It is extruded to a thickness of 685.71 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.13109025641025773\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(98.109293, 172.050023), (98.109293, 165.840485), (85.000267, 165.840485), (85.000267, 172.050023), (98.109293, 172.050023)], [(98.109293, 61.950023), (98.109293, 151.840485), (85.000267, 151.840485)], [(85.000267, 61.950023), (85.000267, 151.840485)], [(98.109293, 61.950023), (85.000267, 61.950023)], [(112.109293, 165.840485), (201.999754, 165.840485), (201.999754, 172.050023)], [(112.109293, 172.050023), (201.999754, 172.050023)], [(112.109293, 165.840485), (112.109293, 172.050023)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (98.1093, 172.05), (85.0003, 172.05), (91.5548, 161.05)), ('vertical', '47.3684', (98.1093, 165.8405), (98.1093, 172.05), (87.1093, 168.9452)), ('horizontal', '685.714', (112.1093, 165.8405), (201.9997, 165.8405), (157.0545, 176.8405))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0003_00035378_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0007_00072708","images":["images/0007_00072708.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 58.95 mm tall. It is extruded to a thickness of 5.21 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.924456953642382\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(180.315403, 99.160297), (180.315403, 153.654602), (87.869708, 153.654602), (87.869708, 99.160297), (180.315403, 99.160297)], [(180.315403, 85.160297), (180.315403, 80.345417)], [(87.869708, 85.160297), (87.869708, 80.345417), (180.315403, 80.345417)], [(87.869708, 85.160297), (180.315403, 85.160297)], [(199.130283, 153.654602), (194.315403, 153.654602), (194.315403, 99.160297)], [(199.130283, 99.160297), (194.315403, 99.160297)], [(199.130283, 153.654602), (199.130283, 99.160297)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (180.3154, 99.1603), (87.8697, 99.1603), (134.0926, 88.1603)), ('vertical', '58.9474', (180.3154, 153.6546), (180.3154, 99.1603), (191.3154, 126.4074)), ('horizontal', '5.2083', (199.1303, 153.6546), (194.3154, 153.6546), (196.7229, 142.6546))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0007_00072708_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0008_00080025","images":["images/0008_00080025.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 32.63 mm tall. It is extruded to a thickness of 3.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1078809523810058\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(190.162993, 107.655157), (190.162993, 143.807062), (79.374898, 143.807062), (79.374898, 107.655157), (190.162993, 107.655157)], [(190.162993, 93.655157), (190.162993, 90.193029)], [(79.374898, 93.655157), (79.374898, 90.193029), (190.162993, 90.193029)], [(79.374898, 93.655157), (190.162993, 93.655157)], [(207.625121, 143.807062), (204.162993, 143.807062), (204.162993, 107.655157)], [(207.625121, 107.655157), (204.162993, 107.655157)], [(207.625121, 143.807062), (207.625121, 107.655157)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (190.163, 107.6551), (79.3749, 107.6551), (134.7689, 96.6551)), ('vertical', '32.6316', (190.163, 143.8071), (190.163, 107.6551), (201.163, 125.7311)), ('horizontal', '3.125', (207.6251, 143.8071), (204.163, 143.8071), (205.894, 132.8071))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0008_00080025_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0013_00136210","images":["images/0013_00136210.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of 33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1020500000000029\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(173.235, 170.208716), (173.235, 114.526189), (63.03, 114.526189), (63.03, 170.208716), (173.235, 170.208716)], [(173.235, 63.791189), (173.235, 100.526189), (63.03, 100.526189)], [(63.03, 63.791189), (63.03, 100.526189)], [(173.235, 63.791189), (63.03, 63.791189)], [(187.235, 114.526189), (223.97, 114.526189), (223.97, 170.208716)], [(187.235, 170.208716), (223.97, 170.208716)], [(187.235, 114.526189), (187.235, 170.208716)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (173.235, 170.2087), (63.03, 170.2087), (118.1325, 159.2087)), ('vertical', '50.5263', (173.235, 114.5262), (173.235, 170.2087), (162.235, 142.3675)), ('horizontal', '33.3333', (187.235, 114.5262), (223.97, 114.5262), (205.6025, 125.5262))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0013_00136210_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0013_00137371","images":["images/0013_00137371.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 34.74 mm tall. It is extruded to a thickness of 2.6 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4321055837563406\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(206.240583, 150.738115), (206.240583, 100.99129), (63.030025, 100.99129), (63.030025, 150.738115), (206.240583, 150.738115)], [(206.240583, 83.261848), (206.240583, 86.99129), (63.030025, 86.99129)], [(63.030025, 83.261848), (63.030025, 86.99129)], [(206.240583, 83.261848), (63.030025, 83.261848)], [(220.240583, 100.99129), (223.970025, 100.99129), (223.970025, 150.738115)], [(220.240583, 150.738115), (223.970025, 150.738115)], [(220.240583, 100.99129), (220.240583, 150.738115)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (206.2406, 150.7381), (63.03, 150.7381), (134.6353, 139.7381)), ('vertical', '34.7368', (206.2406, 100.9913), (206.2406, 150.7381), (195.2406, 125.8647)), ('horizontal', '2.6042', (220.2406, 100.9913), (223.97, 100.9913), (222.1053, 111.9913))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0013_00137371_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0014_00144795","images":["images/0014_00144795.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 75.79 mm wide and 100 mm tall. It is extruded to a thickness of 64.58 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5838987341772269\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(139.77161, 113.660116), (139.77161, 172.049989), (95.518232, 172.049989), (95.518232, 113.660116), (139.77161, 113.660116)], [(139.77161, 99.660116), (139.77161, 61.949989)], [(95.518232, 99.660116), (95.518232, 61.949989), (139.77161, 61.949989)], [(95.518232, 99.660116), (139.77161, 99.660116)], [(191.481737, 172.049989), (153.77161, 172.049989), (153.77161, 113.660116)], [(191.481737, 113.660116), (153.77161, 113.660116)], [(191.481737, 172.049989), (191.481737, 113.660116)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '75.7895', (139.7716, 113.6601), (95.5182, 113.6601), (117.6449, 102.6601)), ('vertical', '100', (139.7716, 172.05), (139.7716, 113.6601), (150.7716, 142.8551)), ('horizontal', '64.5833', (191.4818, 172.05), (153.7716, 172.05), (172.6267, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0014_00144795_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0017_00171050","images":["images/0017_00171050.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 81.05 mm tall. It is extruded to a thickness of 26.71 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8115872093023362\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(166.239687, 101.949053), (166.239687, 167.730332), (85.080966, 167.730332), (85.080966, 101.949053), (166.239687, 101.949053)], [(166.239687, 87.949053), (166.239687, 66.269668)], [(85.080966, 87.949053), (85.080966, 66.269668), (166.239687, 66.269668)], [(85.080966, 87.949053), (166.239687, 87.949053)], [(201.919072, 167.730332), (180.239687, 167.730332), (180.239687, 101.949053)], [(201.919072, 101.949053), (180.239687, 101.949053)], [(201.919072, 167.730332), (201.919072, 101.949053)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (166.2397, 101.9491), (85.0809, 101.9491), (125.6603, 90.9491)), ('vertical', '81.0526', (166.2397, 167.7303), (166.2397, 101.9491), (177.2397, 134.8397)), ('horizontal', '26.7123', (201.9191, 167.7303), (180.2397, 167.7303), (191.0794, 156.7303))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0017_00171050_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0017_00175955","images":["images/0017_00175955.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 98.95 mm tall. It is extruded to a thickness of 120 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4389182692307684\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(132.110807, 128.620195), (132.110807, 172.050003), (88.21898, 172.050003), (88.21898, 128.620195), (132.110807, 128.620195)], [(132.110807, 114.620195), (132.110807, 61.950003)], [(88.21898, 114.620195), (88.21898, 61.950003), (132.110807, 61.950003)], [(88.21898, 114.620195), (132.110807, 114.620195)], [(198.780999, 172.050003), (146.110807, 172.050003), (146.110807, 128.620195)], [(198.780999, 128.620195), (146.110807, 128.620195)], [(198.780999, 172.050003), (198.780999, 128.620195)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (132.1108, 128.6202), (88.219, 128.6202), (110.1649, 117.6202)), ('vertical', '98.9474', (132.1108, 172.05), (132.1108, 128.6202), (143.1108, 150.3351)), ('horizontal', '120', (198.781, 172.05), (146.1108, 172.05), (172.4459, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0017_00175955_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0018_00189970","images":["images/0018_00189970.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 172.05), (136.5, 124.0), (88.45, 124.0), (88.45, 172.05), (136.5, 172.05)], [(136.5, 61.95), (136.5, 110.0), (88.45, 110.0)], [(88.45, 61.95), (88.45, 110.0)], [(136.5, 61.95), (88.45, 61.95)], [(150.5, 124.0), (198.55, 124.0), (198.55, 172.05)], [(150.5, 172.05), (198.55, 172.05)], [(150.5, 124.0), (150.5, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)), ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)), ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0018_00189970_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0021_00213687","images":["images/0021_00213687.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 1.81 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.0907022107137785\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.088504, 266.179179), (190.040594, 172.05), (80.988497, 172.05), (136.088504, 266.179179)], [(190.040594, 156.079179), (190.040594, 158.05), (80.988497, 158.05)], [(80.988497, 156.079179), (80.988497, 158.05)], [(190.040594, 156.079179), (80.988497, 156.079179)], [(204.040594, 266.179179), (206.011415, 266.179179)], [(204.040594, 172.05), (206.011415, 172.05), (206.011415, 266.179179)], [(204.040594, 172.05), (204.040594, 266.179179)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(136.0885, 61.95, 136.0885, 63.9208)]\nDIMENSIONS = [('horizontal', '99.9834', (190.0406, 172.05), (80.9885, 172.05), (135.5146, 161.05)), ('aligned', '99.4725', (136.0885, 77.9208), (190.0406, 172.05), (153.5211, 130.4555)), ('aligned', '100', (80.9885, 172.05), (136.0885, 77.9208), (118.0317, 130.5424)), ('horizontal', '1.8069', (204.0406, 172.05), (206.0114, 172.05), (205.026, 183.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0021_00213687_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0023_00232498","images":["images/0023_00232498.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 172.05), (136.5, 124.0), (88.45, 124.0), (88.45, 172.05), (136.5, 172.05)], [(136.5, 61.95), (136.5, 110.0)], [(88.45, 61.95), (88.45, 110.0), (136.5, 110.0)], [(88.45, 61.95), (136.5, 61.95)], [(198.55, 124.0), (150.5, 124.0), (150.5, 172.05)], [(198.55, 172.05), (150.5, 172.05)], [(198.55, 124.0), (198.55, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)), ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)), ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0023_00232498_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0023_00239527","images":["images/0023_00239527.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 33.68 mm tall. It is extruded to a thickness of 252.63 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.17831054687502568\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(100.368661, 166.04377), (100.368661, 172.05002)], [(82.537606, 166.04377), (100.368661, 166.04377)], [(100.368661, 172.05002), (82.537606, 172.05002), (82.537606, 166.04377)], [(100.368661, 61.95002), (100.368661, 152.04377)], [(82.537606, 61.95002), (82.537606, 152.04377)], [(82.537606, 61.95002), (100.368661, 61.95002)], [(82.537606, 152.04377), (100.368661, 152.04377)], [(114.368661, 166.04377), (204.462411, 166.04377)], [(204.462411, 172.05002), (114.368661, 172.05002), (114.368661, 166.04377)], [(204.462411, 172.05002), (204.462411, 166.04377)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (100.3687, 166.0438), (82.5376, 166.0438), (91.4531, 155.0438)), ('vertical', '33.6842', (100.3687, 172.05), (100.3687, 166.0438), (111.3687, 169.0469)), ('horizontal', '505.263', (204.4624, 172.05), (114.3686, 172.05), (159.4155, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0023_00239527_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0026_00266356","images":["images/0026_00266356.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 2.11 mm tall. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9411855670103068\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 170.068534), (136.5, 172.049977), (42.381443, 172.049977), (42.381443, 170.068534), (136.5, 170.068534)], [(136.5, 156.068534), (136.5, 61.949977)], [(42.381443, 156.068534), (42.381443, 61.949977), (136.5, 61.949977)], [(42.381443, 156.068534), (136.5, 156.068534)], [(244.618557, 172.049977), (150.5, 172.049977), (150.5, 170.068534)], [(244.618557, 170.068534), (150.5, 170.068534)], [(244.618557, 172.049977), (244.618557, 170.068534)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 170.0685), (42.3814, 170.0685), (89.4407, 159.0685)), ('vertical', '2.1053', (136.5, 172.05), (136.5, 170.0685), (147.5, 171.0593)), ('horizontal', '100', (244.6186, 172.05), (150.5, 172.05), (197.5593, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0026_00266356_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0027_00272690","images":["images/0027_00272690.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 65.26 mm wide and 100 mm tall. It is extruded to a thickness of 3.65 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9271959798995005\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(165.065667, 172.049999), (165.065667, 79.330401), (104.553929, 79.330401), (104.553929, 172.049999), (165.065667, 172.049999)], [(165.065667, 61.949999), (165.065667, 65.330401), (104.553929, 65.330401)], [(104.553929, 61.949999), (104.553929, 65.330401)], [(165.065667, 61.949999), (104.553929, 61.949999)], [(179.065667, 79.330401), (182.446069, 79.330401), (182.446069, 172.049999)], [(179.065667, 172.049999), (182.446069, 172.049999)], [(179.065667, 79.330401), (179.065667, 172.049999)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '65.2632', (165.0657, 172.05), (104.5539, 172.05), (134.8098, 161.05)), ('vertical', '100', (165.0657, 79.3304), (165.0657, 172.05), (154.0657, 125.6902)), ('horizontal', '3.6458', (179.0657, 79.3304), (182.446, 79.3304), (180.7559, 90.3304))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0027_00272690_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0028_00284857","images":["images/0028_00284857.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 80 mm tall. It is extruded to a thickness of 80.21 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5998439531859682\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(142.435982, 124.06249), (142.435982, 172.050007), (82.451587, 172.050007), (82.451587, 124.06249), (142.435982, 124.06249)], [(142.435982, 110.06249), (142.435982, 61.950007)], [(82.451587, 110.06249), (82.451587, 61.950007), (142.435982, 61.950007)], [(82.451587, 110.06249), (142.435982, 110.06249)], [(204.548466, 172.050007), (156.435982, 172.050007), (156.435982, 124.06249)], [(204.548466, 124.06249), (156.435982, 124.06249)], [(204.548466, 172.050007), (204.548466, 124.06249)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (142.436, 124.0625), (82.4516, 124.0625), (112.4438, 113.0625)), ('vertical', '80', (142.436, 172.05), (142.436, 124.0625), (153.436, 148.0562)), ('horizontal', '80.2083', (204.5484, 172.05), (156.436, 172.05), (180.4922, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0028_00284857_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0028_00287672","images":["images/0028_00287672.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 98.95 mm wide and 100 mm tall. It is extruded to a thickness of 66.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5765999999999989\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(145.806511, 172.05), (145.806511, 114.39), (88.753458, 114.39), (88.753458, 172.05), (145.806511, 172.05)], [(145.806511, 61.95), (145.806511, 100.39), (88.753458, 100.39)], [(88.753458, 61.95), (88.753458, 100.39)], [(145.806511, 61.95), (88.753458, 61.95)], [(159.806511, 114.39), (198.246511, 114.39), (198.246511, 172.05)], [(159.806511, 172.05), (198.246511, 172.05)], [(159.806511, 114.39), (159.806511, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '98.9474', (145.8065, 172.05), (88.7535, 172.05), (117.28, 161.05)), ('vertical', '100', (145.8065, 114.39), (145.8065, 172.05), (134.8065, 143.22)), ('horizontal', '66.6667', (159.8065, 114.39), (198.2465, 114.39), (179.0265, 125.39))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0028_00287672_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0030_00307931","images":["images/0030_00307931.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 2.11 mm tall. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 161.508362), (136.5, 159.961625), (63.03, 159.961625), (63.03, 161.508362), (136.5, 161.508362)], [(136.5, 72.491625), (136.5, 145.961625), (63.03, 145.961625)], [(63.03, 72.491625), (63.03, 145.961625)], [(136.5, 72.491625), (63.03, 72.491625)], [(150.5, 159.961625), (223.97, 159.961625), (223.97, 161.508362)], [(150.5, 161.508362), (223.97, 161.508362)], [(150.5, 159.961625), (150.5, 161.508362)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 161.5084), (63.03, 161.5084), (99.765, 150.5084)), ('vertical', '2.1053', (136.5, 159.9616), (136.5, 161.5084), (125.5, 160.735)), ('horizontal', '100', (150.5, 159.9616), (223.97, 159.9616), (187.235, 170.9616))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0030_00307931_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0031_00315230","images":["images/0031_00315230.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 60 mm tall. It is extruded to a thickness of 6.25 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9183749999999999\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(179.548811, 99.3186), (179.548811, 154.4211), (87.711311, 154.4211), (87.711311, 99.3186), (179.548811, 99.3186)], [(179.548811, 85.3186), (179.548811, 79.578756)], [(87.711311, 85.3186), (87.711311, 79.578756), (179.548811, 79.578756)], [(87.711311, 85.3186), (179.548811, 85.3186)], [(199.288655, 154.4211), (193.548811, 154.4211), (193.548811, 99.3186)], [(199.288655, 99.3186), (193.548811, 99.3186)], [(199.288655, 154.4211), (199.288655, 99.3186)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (179.5488, 99.3186), (87.7113, 99.3186), (133.6301, 88.3186)), ('vertical', '60', (179.5488, 154.4211), (179.5488, 99.3186), (190.5488, 126.8699)), ('horizontal', '6.25', (199.2887, 154.4211), (193.5488, 154.4211), (196.4187, 143.4211))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0031_00315230_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0032_00321038","images":["images/0032_00321038.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 80 mm tall. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5338888888888887\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 129.338893), (136.5, 172.050004), (83.111111, 172.050004), (83.111111, 129.338893), (136.5, 129.338893)], [(136.5, 115.338893), (136.5, 61.950004)], [(83.111111, 115.338893), (83.111111, 61.950004), (136.5, 61.950004)], [(83.111111, 115.338893), (136.5, 115.338893)], [(203.888889, 172.050004), (150.5, 172.050004), (150.5, 129.338893)], [(203.888889, 129.338893), (150.5, 129.338893)], [(203.888889, 172.050004), (203.888889, 129.338893)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 129.3389), (83.1111, 129.3389), (109.8055, 118.3389)), ('vertical', '80', (136.5, 172.05), (136.5, 129.3389), (147.5, 150.6944)), ('horizontal', '100', (203.8889, 172.05), (150.5, 172.05), (177.1944, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0032_00321038_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0032_00327978","images":["images/0032_00327978.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 5.26 mm wide and 100 mm tall. It is extruded to a thickness of 5.49 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9109479166667312\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.394611, 80.955205), (136.394611, 172.049997), (131.600148, 172.049997), (131.600148, 80.955205), (136.394611, 80.955205)], [(136.394611, 66.955205), (136.394611, 61.949997)], [(131.600148, 66.955205), (131.600148, 61.949997), (136.394611, 61.949997)], [(131.600148, 66.955205), (136.394611, 66.955205)], [(155.399819, 172.049997), (150.394611, 172.049997), (150.394611, 80.955205)], [(155.399819, 80.955205), (150.394611, 80.955205)], [(155.399819, 172.049997), (155.399819, 80.955205)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '5.2632', (136.3946, 80.9552), (131.6002, 80.9552), (133.9974, 69.9552)), ('vertical', '100', (136.3946, 172.05), (136.3946, 80.9552), (147.3946, 126.5026)), ('horizontal', '5.4945', (155.3998, 172.05), (150.3946, 172.05), (152.8972, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0032_00327978_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00335015","images":["images/0033_00335015.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of 8.38 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9761748251749331\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(181.22006, 103.42749), (181.22006, 152.750007), (83.602578, 152.750007), (83.602578, 103.42749), (181.22006, 103.42749)], [(181.22006, 89.42749), (181.22006, 81.250109)], [(83.602578, 89.42749), (83.602578, 81.250109), (181.22006, 81.250109)], [(83.602578, 89.42749), (181.22006, 89.42749)], [(203.397441, 152.750007), (195.22006, 152.750007), (195.22006, 103.42749)], [(203.397441, 103.42749), (195.22006, 103.42749)], [(203.397441, 152.750007), (203.397441, 103.42749)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (181.2201, 103.4275), (83.6026, 103.4275), (132.4113, 92.4275)), ('vertical', '50.5263', (181.2201, 152.75), (181.2201, 103.4275), (192.2201, 128.0887)), ('horizontal', '8.377', (203.3974, 152.75), (195.22, 152.75), (199.3087, 141.75))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00335015_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0034_00343153","images":["images/0034_00343153.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 21.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347000000000624\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(165.490826, 95.0091), (165.490826, 168.4791), (92.020826, 168.4791), (92.020826, 95.0091), (165.490826, 95.0091)], [(165.490826, 81.0091), (165.490826, 65.52083)], [(92.020826, 81.0091), (92.020826, 65.52083), (165.490826, 65.52083)], [(92.020826, 81.0091), (165.490826, 81.0091)], [(194.979096, 168.4791), (179.490826, 168.4791), (179.490826, 95.0091)], [(194.979096, 95.0091), (179.490826, 95.0091)], [(194.979096, 168.4791), (194.979096, 95.0091)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (165.4908, 95.0091), (92.0208, 95.0091), (128.7558, 84.0091)), ('vertical', '100', (165.4908, 168.4791), (165.4908, 95.0091), (176.4908, 131.7441)), ('horizontal', '21.0811', (194.9791, 168.4791), (179.4909, 168.4791), (187.235, 157.4791))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0034_00343153_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0035_00358489","images":["images/0035_00358489.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 92.63 mm wide and 100 mm tall. It is extruded to a thickness of 24.1 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7628032786886569\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.639394, 95.050283), (162.639394, 171.330611), (91.979722, 171.330611), (91.979722, 95.050283), (162.639394, 95.050283)], [(162.639394, 81.050283), (162.639394, 62.669481)], [(91.979722, 81.050283), (91.979722, 62.669481), (162.639394, 62.669481)], [(91.979722, 81.050283), (162.639394, 81.050283)], [(195.020196, 171.330611), (176.639394, 171.330611), (176.639394, 95.050283)], [(195.020196, 95.050283), (176.639394, 95.050283)], [(195.020196, 171.330611), (195.020196, 95.050283)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '92.6316', (162.6394, 95.0503), (91.9797, 95.0503), (127.3096, 84.0503)), ('vertical', '100', (162.6394, 171.3306), (162.6394, 95.0503), (173.6394, 133.1904)), ('horizontal', '24.0964', (195.0202, 171.3306), (176.6394, 171.3306), (185.8298, 160.3306))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0035_00358489_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0036_00365253","images":["images/0036_00365253.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 21.05 mm tall. It is extruded to a thickness of 0.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.2138521739131072\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(196.876501, 111.53871), (196.876501, 137.093493), (75.491283, 137.093493), (75.491283, 111.53871), (196.876501, 111.53871)], [(196.876501, 97.53871), (196.876501, 96.906496)], [(75.491283, 97.53871), (75.491283, 96.906496), (196.876501, 96.906496)], [(75.491283, 97.53871), (196.876501, 97.53871)], [(211.508715, 137.093493), (210.876501, 137.093493), (210.876501, 111.53871)], [(211.508715, 111.53871), (210.876501, 111.53871)], [(211.508715, 137.093493), (211.508715, 111.53871)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (196.8765, 111.5387), (75.4913, 111.5387), (136.1839, 100.5387)), ('vertical', '21.0526', (196.8765, 137.0935), (196.8765, 111.5387), (207.8765, 124.3161)), ('horizontal', '0.5208', (211.5087, 137.0935), (210.8765, 137.0935), (211.1926, 126.0935))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0036_00365253_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0037_00372485","images":["images/0037_00372485.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 36.84 mm tall. It is extruded to a thickness of 21.88 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.0737923076923066\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(178.445005, 115.964218), (178.445005, 155.524988), (71.065774, 155.524988), (71.065774, 115.964218), (178.445005, 115.964218)], [(178.445005, 101.964218), (178.445005, 78.475012)], [(71.065774, 101.964218), (71.065774, 78.475012), (178.445005, 78.475012)], [(71.065774, 101.964218), (178.445005, 101.964218)], [(215.934212, 155.524988), (192.445005, 155.524988), (192.445005, 115.964218)], [(215.934212, 115.964218), (192.445005, 115.964218)], [(215.934212, 155.524988), (215.934212, 115.964218)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (178.445, 115.9642), (71.0658, 115.9642), (124.7554, 104.9642)), ('vertical', '36.8421', (178.445, 155.525), (178.445, 115.9642), (189.445, 135.7446)), ('horizontal', '21.875', (215.9342, 155.525), (192.445, 155.525), (204.1896, 144.525))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0037_00372485_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0037_00378577","images":["images/0037_00378577.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 50.53 mm wide and 100 mm tall. It is extruded to a thickness of 8.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8870769230769259\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(155.214204, 172.049995), (155.214204, 83.342303), (110.393475, 83.342303), (110.393475, 172.049995), (155.214204, 172.049995)], [(155.214204, 61.949995), (155.214204, 69.342303), (110.393475, 69.342303)], [(110.393475, 61.949995), (110.393475, 69.342303)], [(155.214204, 61.949995), (110.393475, 61.949995)], [(169.214204, 83.342303), (176.606512, 83.342303), (176.606512, 172.049995)], [(169.214204, 172.049995), (176.606512, 172.049995)], [(169.214204, 83.342303), (169.214204, 172.049995)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '50.5263', (155.2142, 172.05), (110.3935, 172.05), (132.8038, 161.05)), ('vertical', '100', (155.2142, 83.3423), (155.2142, 172.05), (144.2142, 127.6962)), ('horizontal', '8.3333', (169.2142, 83.3423), (176.6065, 83.3423), (172.9103, 94.3423))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0037_00378577_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0038_00388817","images":["images/0038_00388817.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 74.74 mm tall. It is extruded to a thickness of 72.73 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6516839714471205\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(145.3866, 172.050001), (145.3866, 123.345199), (80.218203, 123.345199), (80.218203, 172.050001), (145.3866, 172.050001)], [(145.3866, 61.950001), (145.3866, 109.345199), (80.218203, 109.345199)], [(80.218203, 61.950001), (80.218203, 109.345199)], [(145.3866, 61.950001), (80.218203, 61.950001)], [(159.3866, 123.345199), (206.781798, 123.345199), (206.781798, 172.050001)], [(159.3866, 172.050001), (206.781798, 172.050001)], [(159.3866, 123.345199), (159.3866, 172.050001)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (145.3866, 172.05), (80.2182, 172.05), (112.8024, 161.05)), ('vertical', '74.7368', (145.3866, 123.3452), (145.3866, 172.05), (134.3866, 147.6976)), ('horizontal', '72.7273', (159.3866, 123.3452), (206.7818, 123.3452), (183.0842, 134.3452))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0038_00388817_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0041_00419590","images":["images/0041_00419590.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 47.37 mm tall. It is extruded to a thickness of 218.18 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.36189009009010065\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(115.115594, 172.049977), (115.115594, 154.907815), (78.926585, 154.907815), (78.926585, 172.049977), (115.115594, 172.049977)], [(115.115594, 61.949977), (115.115594, 140.907815), (78.926585, 140.907815)], [(78.926585, 61.949977), (78.926585, 140.907815)], [(115.115594, 61.949977), (78.926585, 61.949977)], [(129.115594, 154.907815), (208.073432, 154.907815), (208.073432, 172.049977)], [(129.115594, 172.049977), (208.073432, 172.049977)], [(129.115594, 154.907815), (129.115594, 172.049977)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (115.1156, 172.05), (78.9266, 172.05), (97.0211, 161.05)), ('vertical', '47.3684', (115.1156, 154.9078), (115.1156, 172.05), (104.1156, 163.4789)), ('horizontal', '218.182', (129.1156, 154.9078), (208.0734, 154.9078), (168.5945, 165.9078))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0041_00419590_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0043_00431992","images":["images/0043_00431992.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 83.16 mm wide and 100 mm tall. It is extruded to a thickness of 47.92 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.649690140845069\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(147.947916, 172.050008), (147.947916, 107.080994), (93.921051, 107.080994), (93.921051, 172.050008), (147.947916, 172.050008)], [(147.947916, 61.950008), (147.947916, 93.080994), (93.921051, 93.080994)], [(93.921051, 61.950008), (93.921051, 93.080994)], [(147.947916, 61.950008), (93.921051, 61.950008)], [(161.947916, 107.080994), (193.078902, 107.080994), (193.078902, 172.050008)], [(161.947916, 172.050008), (193.078902, 172.050008)], [(161.947916, 107.080994), (161.947916, 172.050008)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '83.1579', (147.9479, 172.05), (93.9211, 172.05), (120.9345, 161.05)), ('vertical', '100', (147.9479, 107.081), (147.9479, 172.05), (136.9479, 139.5655)), ('horizontal', '47.9167', (161.9479, 107.081), (193.0789, 107.081), (177.5134, 118.081))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0043_00431992_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0044_00440833","images":["images/0044_00440833.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 1213.87 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.06808915556985275\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(94.730391, 172.050017), (100.82047, 169.004977), (101.2011, 162.280515), (95.618528, 158.601092), (89.528448, 161.646132), (89.147818, 168.370594), (94.730391, 172.050017)], [(94.730391, 61.950017), (94.730391, 144.601092), (100.82047, 144.601092)], [(100.82047, 61.950017), (100.82047, 144.601092)], [(94.730391, 61.950017), (100.82047, 61.950017)], [(100.82047, 144.601092), (101.2011, 144.601092)], [(101.2011, 61.950017), (101.2011, 144.601092)], [(100.82047, 61.950017), (101.2011, 61.950017)], [(89.147818, 61.950017), (89.147818, 144.601092), (94.730391, 144.601092)], [(89.147818, 61.950017), (94.730391, 61.950017)], [(197.852175, 172.050017), (115.2011, 172.050017)], [(197.852175, 158.601092), (115.2011, 158.601092), (115.2011, 161.646132)], [(197.852175, 161.646132), (115.2011, 161.646132)], [(197.852175, 158.601092), (197.852175, 161.646132)], [(115.2011, 161.646132), (115.2011, 168.370594)], [(197.852175, 168.370594), (115.2011, 168.370594)], [(197.852175, 161.646132), (197.852175, 168.370594)], [(115.2011, 168.370594), (115.2011, 172.050017)], [(197.852175, 168.370594), (197.852175, 172.050017)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(95.6185, 144.6011, 95.6185, 61.95), (197.8522, 161.6461, 115.2011, 161.6461), (197.8522, 168.3706, 115.2011, 168.3706)]\nDIMENSIONS = [('aligned', '100', (94.7304, 172.05), (100.8205, 169.005), (102.6948, 180.3662)), ('vertical', '98.9178', (100.8205, 169.005), (101.2011, 162.2805), (111.9932, 166.2644)), ('aligned', '98.1955', (101.2011, 162.2805), (95.6185, 158.6011), (104.4633, 151.2562)), ('aligned', '100', (95.6185, 158.6011), (89.5284, 161.6461), (87.6541, 150.2849)), ('vertical', '98.9178', (89.5284, 161.6461), (89.1478, 168.3706), (78.3557, 164.3867)), ('aligned', '98.1955', (89.1478, 168.3706), (94.7304, 172.05), (85.8857, 179.3948)), ('horizontal', '1213.87', (197.8522, 168.3706), (115.2011, 168.3706), (156.5266, 157.3706))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0044_00440833_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0046_00467896","images":["images/0046_00467896.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 62.11 mm tall. It is extruded to a thickness of 25 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1032628398791506\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(177.872383, 172.050017), (177.872383, 103.531588), (67.546099, 103.531588), (67.546099, 172.050017), (177.872383, 172.050017)], [(177.872383, 61.950017), (177.872383, 89.531588), (67.546099, 89.531588)], [(67.546099, 61.950017), (67.546099, 89.531588)], [(177.872383, 61.950017), (67.546099, 61.950017)], [(191.872383, 103.531588), (219.453954, 103.531588), (219.453954, 172.050017)], [(191.872383, 172.050017), (219.453954, 172.050017)], [(191.872383, 103.531588), (191.872383, 172.050017)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (177.8724, 172.05), (67.5461, 172.05), (122.7092, 161.05)), ('vertical', '62.1053', (177.8724, 103.5316), (177.8724, 172.05), (166.8724, 137.7908)), ('horizontal', '25', (191.8724, 103.5316), (219.4539, 103.5316), (205.6631, 114.5316))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0046_00467896_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0047_00478067","images":["images/0047_00478067.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 85.26 mm wide and 100 mm tall. It is extruded to a thickness of 252.63 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.2725223880597551\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(113.694192, 144.797737), (113.694192, 172.049976), (90.458072, 172.049976), (90.458072, 144.797737), (113.694192, 144.797737)], [(113.694192, 130.797737), (113.694192, 61.949976)], [(90.458072, 130.797737), (90.458072, 61.949976), (113.694192, 61.949976)], [(90.458072, 130.797737), (113.694192, 130.797737)], [(196.541953, 172.049976), (127.694192, 172.049976), (127.694192, 144.797737)], [(196.541953, 144.797737), (127.694192, 144.797737)], [(196.541953, 172.049976), (196.541953, 144.797737)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '85.2632', (113.6942, 144.7977), (90.4581, 144.7977), (102.0761, 133.7977)), ('vertical', '100', (113.6942, 172.05), (113.6942, 144.7977), (124.6942, 158.4239)), ('horizontal', '252.632', (196.5419, 172.05), (127.6942, 172.05), (162.1181, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0047_00478067_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0047_00478650","images":["images/0047_00478650.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 15.79 mm tall. It is extruded to a thickness of 1371.43 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.06927533875336611\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(92.460691, 170.956187), (92.460691, 172.050008), (85.533157, 172.050008), (85.533157, 170.956187), (92.460691, 170.956187)], [(92.460691, 156.956187), (92.460691, 61.950008)], [(85.533157, 156.956187), (85.533157, 61.950008), (92.460691, 61.950008)], [(85.533157, 156.956187), (92.460691, 156.956187)], [(201.46687, 172.050008), (106.460691, 172.050008), (106.460691, 170.956187)], [(201.46687, 170.956187), (106.460691, 170.956187)], [(201.46687, 172.050008), (201.46687, 170.956187)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (92.4607, 170.9562), (85.5331, 170.9562), (88.9969, 159.9562)), ('vertical', '15.7895', (92.4607, 172.05), (92.4607, 170.9562), (103.4607, 171.5031)), ('horizontal', '1371.43', (201.4669, 172.05), (106.4607, 172.05), (153.9638, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0047_00478650_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0047_00478724","images":["images/0047_00478724.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 14.74 mm tall. It is extruded to a thickness of 21.48 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.2096165745856462\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(183.991683, 145.902157), (183.991683, 128.076229), (63.030026, 128.076229), (63.030026, 145.902157), (183.991683, 145.902157)], [(183.991683, 88.097886), (183.991683, 114.076229), (63.030026, 114.076229)], [(63.030026, 88.097886), (63.030026, 114.076229)], [(183.991683, 88.097886), (63.030026, 88.097886)], [(197.991683, 128.076229), (223.970026, 128.076229), (223.970026, 145.902157)], [(197.991683, 145.902157), (223.970026, 145.902157)], [(197.991683, 128.076229), (197.991683, 145.902157)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (183.9917, 145.9022), (63.03, 145.9022), (123.5109, 134.9022)), ('vertical', '14.7368', (183.9917, 128.0762), (183.9917, 145.9022), (172.9917, 136.9892)), ('horizontal', '21.4765', (197.9917, 128.0762), (223.97, 128.0762), (210.9808, 139.0762))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0047_00478724_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00484580","images":["images/0048_00484580.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 26.32 mm tall. It is extruded to a thickness of 6.62 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3781958620690626\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(200.849574, 146.694347), (200.849574, 110.426035), (63.029988, 110.426035), (63.029988, 146.694347), (200.849574, 146.694347)], [(200.849574, 87.305621), (200.849574, 96.426035), (63.029988, 96.426035)], [(63.029988, 87.305621), (63.029988, 96.426035)], [(200.849574, 87.305621), (63.029988, 87.305621)], [(214.849574, 110.426035), (223.969988, 110.426035), (223.969988, 146.694347)], [(214.849574, 146.694347), (223.969988, 146.694347)], [(214.849574, 110.426035), (214.849574, 146.694347)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (200.8496, 146.6944), (63.03, 146.6944), (131.9398, 135.6944)), ('vertical', '26.3158', (200.8496, 110.426), (200.8496, 146.6944), (189.8496, 128.5602)), ('horizontal', '6.6176', (214.8496, 110.426), (223.9699, 110.426), (219.4098, 121.426))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00484580_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00484583","images":["images/0048_00484583.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 30.53 mm tall. It is extruded to a thickness of 7.69 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3644428571428786\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(199.474294, 150.073608), (199.474294, 108.422195), (63.030009, 108.422195), (63.030009, 150.073608), (199.474294, 150.073608)], [(199.474294, 83.92648), (199.474294, 94.422195), (63.030009, 94.422195)], [(63.030009, 83.92648), (63.030009, 94.422195)], [(199.474294, 83.92648), (63.030009, 83.92648)], [(213.474294, 108.422195), (223.970009, 108.422195), (223.970009, 150.073608)], [(213.474294, 150.073608), (223.970009, 150.073608)], [(213.474294, 108.422195), (213.474294, 150.073608)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (199.4743, 150.0736), (63.03, 150.0736), (131.2521, 139.0736)), ('vertical', '30.5263', (199.4743, 108.4222), (199.4743, 150.0736), (188.4743, 129.2479)), ('horizontal', '7.6923', (213.4743, 108.4222), (223.97, 108.4222), (218.7221, 119.4222))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00484583_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00488749","images":["images/0048_00488749.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 50 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.48049999999999987\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 124.0), (136.5, 172.05)], [(88.45, 124.0), (136.5, 124.0)], [(136.5, 172.05), (88.45, 172.05), (88.45, 124.0)], [(136.5, 61.95), (136.5, 110.0)], [(88.45, 61.95), (88.45, 110.0)], [(88.45, 61.95), (136.5, 61.95)], [(88.45, 110.0), (136.5, 110.0)], [(150.5, 124.0), (198.55, 124.0)], [(198.55, 172.05), (150.5, 172.05), (150.5, 124.0)], [(198.55, 172.05), (198.55, 124.0)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)), ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)), ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00488749_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0049_00490330","images":["images/0049_00490330.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of 33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9761748251749008\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(169.039184, 115.60829), (169.039184, 164.930807), (71.421702, 164.930807), (71.421702, 115.60829), (169.039184, 115.60829)], [(169.039184, 101.60829), (169.039184, 69.069129)], [(71.421702, 101.60829), (71.421702, 69.069129), (169.039184, 69.069129)], [(71.421702, 101.60829), (169.039184, 101.60829)], [(215.578345, 164.930807), (183.039184, 164.930807), (183.039184, 115.60829)], [(215.578345, 115.60829), (183.039184, 115.60829)], [(215.578345, 164.930807), (215.578345, 115.60829)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (169.0392, 115.6083), (71.4217, 115.6083), (120.2304, 104.6083)), ('vertical', '50.5263', (169.0392, 164.9308), (169.0392, 115.6083), (180.0392, 140.2696)), ('horizontal', '33.3333', (215.5783, 164.9308), (183.0392, 164.9308), (199.3088, 153.9308))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0049_00490330_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0049_00496370","images":["images/0049_00496370.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 76.84 mm wide and 100 mm tall. It is extruded to a thickness of 28.65 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7470121457489899\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(154.5016, 172.050009), (154.5016, 97.348794), (97.099614, 97.348794), (97.099614, 172.050009), (154.5016, 172.050009)], [(154.5016, 61.950009), (154.5016, 83.348794), (97.099614, 83.348794)], [(97.099614, 61.950009), (97.099614, 83.348794)], [(154.5016, 61.950009), (97.099614, 61.950009)], [(168.5016, 97.348794), (189.900386, 97.348794), (189.900386, 172.050009)], [(168.5016, 172.050009), (189.900386, 172.050009)], [(168.5016, 97.348794), (168.5016, 172.050009)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '76.8421', (154.5016, 172.05), (97.0996, 172.05), (125.8006, 161.05)), ('vertical', '100', (154.5016, 97.3488), (154.5016, 172.05), (143.5016, 134.6994)), ('horizontal', '28.6458', (168.5016, 97.3488), (189.9004, 97.3488), (179.201, 108.3488))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0049_00496370_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0050_00501404","images":["images/0050_00501404.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 27.37 mm tall. It is extruded to a thickness of 34.38 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.093506976744186\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(172.380699, 157.758436), (172.380699, 127.830876), (63.030001, 127.830876), (63.030001, 157.758436), (172.380699, 157.758436)], [(172.380699, 76.241574), (172.380699, 113.830876), (63.030001, 113.830876)], [(63.030001, 76.241574), (63.030001, 113.830876)], [(172.380699, 76.241574), (63.030001, 76.241574)], [(186.380699, 127.830876), (223.970001, 127.830876), (223.970001, 157.758436)], [(186.380699, 157.758436), (223.970001, 157.758436)], [(186.380699, 127.830876), (186.380699, 157.758436)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (172.3807, 157.7584), (63.03, 157.7584), (117.7053, 146.7584)), ('vertical', '27.3684', (172.3807, 127.8309), (172.3807, 157.7584), (161.3807, 142.7946)), ('horizontal', '34.375', (186.3807, 127.8309), (223.97, 127.8309), (205.1753, 138.8309))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0050_00501404_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0051_00513127","images":["images/0051_00513127.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 83.16 mm wide and 100 mm tall. It is extruded to a thickness of 1.77 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8022586206896819\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(169.147102, 84.597023), (169.147102, 164.822885), (102.432964, 164.822885), (102.432964, 84.597023), (169.147102, 84.597023)], [(169.147102, 70.597023), (169.147102, 69.177096)], [(102.432964, 70.597023), (102.432964, 69.177096), (169.147102, 69.177096)], [(102.432964, 70.597023), (169.147102, 70.597023)], [(184.567029, 164.822885), (183.147102, 164.822885), (183.147102, 84.597023)], [(184.567029, 84.597023), (183.147102, 84.597023)], [(184.567029, 164.822885), (184.567029, 84.597023)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '83.1579', (169.1471, 84.597), (102.433, 84.597), (135.7901, 73.597)), ('vertical', '100', (169.1471, 164.8229), (169.1471, 84.597), (180.1471, 124.7099)), ('horizontal', '1.7699', (184.567, 164.8229), (183.1471, 164.8229), (183.8571, 153.8229))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0051_00513127_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00521800","images":["images/0052_00521800.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 43.16 mm tall. It is extruded to a thickness of -320 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.2646231884057972\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(107.39142, 160.629412), (107.39142, 172.049992), (80.929101, 172.049992), (80.929101, 160.629412), (107.39142, 160.629412)], [(107.39142, 61.949992), (107.39142, 146.629412)], [(80.929101, 61.949992), (80.929101, 146.629412), (107.39142, 146.629412)], [(80.929101, 61.949992), (107.39142, 61.949992)], [(121.39142, 172.049992), (206.07084, 172.049992), (206.07084, 160.629412)], [(121.39142, 160.629412), (206.07084, 160.629412)], [(121.39142, 172.049992), (121.39142, 160.629412)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (107.3914, 160.6294), (80.9291, 160.6294), (94.1603, 149.6294)), ('vertical', '43.1579', (107.3914, 172.05), (107.3914, 160.6294), (118.3914, 166.3397)), ('horizontal', '320', (121.3914, 172.05), (206.0709, 172.05), (163.7312, 183.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00521800_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00529913","images":["images/0052_00529913.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 62.11 mm tall. It is extruded to a thickness of 62.03 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7741847359382077\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(151.199704, 123.969032), (151.199704, 172.049979), (73.78123, 172.049979), (73.78123, 123.969032), (151.199704, 123.969032)], [(151.199704, 109.969032), (151.199704, 61.949979)], [(73.78123, 109.969032), (73.78123, 61.949979), (151.199704, 61.949979)], [(73.78123, 109.969032), (151.199704, 109.969032)], [(213.218757, 172.049979), (165.199704, 172.049979), (165.199704, 123.969032)], [(213.218757, 123.969032), (165.199704, 123.969032)], [(213.218757, 172.049979), (213.218757, 123.969032)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (151.1997, 123.969), (73.7812, 123.969), (112.4905, 112.969)), ('vertical', '62.1053', (151.1997, 172.05), (151.1997, 123.969), (162.1997, 148.0095)), ('horizontal', '62.0253', (213.2188, 172.05), (165.1997, 172.05), (189.2092, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00529913_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0053_00534012","images":["images/0053_00534012.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 40 mm wide and 100 mm tall. It is extruded to a thickness of 204.26 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3158531468531533\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(110.559708, 172.050009), (110.559708, 140.464694), (97.925582, 140.464694), (97.925582, 172.050009), (110.559708, 172.050009)], [(110.559708, 61.950009), (110.559708, 126.464694), (97.925582, 126.464694)], [(97.925582, 61.950009), (97.925582, 126.464694)], [(110.559708, 61.950009), (97.925582, 61.950009)], [(124.559708, 140.464694), (189.074393, 140.464694), (189.074393, 172.050009)], [(124.559708, 172.050009), (189.074393, 172.050009)], [(124.559708, 140.464694), (124.559708, 172.050009)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '40', (110.5597, 172.05), (97.9256, 172.05), (104.2427, 161.05)), ('vertical', '100', (110.5597, 140.4647), (110.5597, 172.05), (99.5597, 156.2573)), ('horizontal', '204.255', (124.5597, 140.4647), (189.0744, 140.4647), (156.8171, 151.4647))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0053_00534012_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0054_00540766","images":["images/0054_00540766.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of -39.58 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(165.988586, 118.65889), (165.988586, 167.981407), (68.371103, 167.981407), (68.371103, 118.65889), (165.988586, 118.65889)], [(165.988586, 66.018636), (165.988586, 104.65889)], [(68.371103, 66.018636), (68.371103, 104.65889), (165.988586, 104.65889)], [(68.371103, 66.018636), (165.988586, 66.018636)], [(179.988586, 167.981407), (218.628839, 167.981407), (218.628839, 118.65889)], [(179.988586, 118.65889), (218.628839, 118.65889)], [(179.988586, 167.981407), (179.988586, 118.65889)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (165.9886, 118.6589), (68.3711, 118.6589), (117.1799, 107.6589)), ('vertical', '50.5263', (165.9886, 167.9814), (165.9886, 118.6589), (176.9886, 143.3201)), ('horizontal', '39.5833', (179.9886, 167.9814), (218.6288, 167.9814), (199.3087, 178.9814))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0054_00540766_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0056_00564584","images":["images/0056_00564584.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 29.47 mm tall. It is extruded to a thickness of 4.17 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4106239999999954\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(204.0924, 147.726892), (204.0924, 106.150605), (63.03, 106.150605), (63.03, 147.726892), (204.0924, 147.726892)], [(204.0924, 86.273005), (204.0924, 92.150605), (63.03, 92.150605)], [(63.03, 86.273005), (63.03, 92.150605)], [(204.0924, 86.273005), (63.03, 86.273005)], [(218.0924, 106.150605), (223.97, 106.150605), (223.97, 147.726892)], [(218.0924, 147.726892), (223.97, 147.726892)], [(218.0924, 106.150605), (218.0924, 147.726892)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (204.0924, 147.7269), (63.03, 147.7269), (133.5612, 136.7269)), ('vertical', '29.4737', (204.0924, 106.1506), (204.0924, 147.7269), (193.0924, 126.9388)), ('horizontal', '4.1667', (218.0924, 106.1506), (223.97, 106.1506), (221.0312, 117.1506))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0056_00564584_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0057_00577279","images":["images/0057_00577279.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of 66.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8200149700599038\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(150.166906, 172.050021), (150.166906, 130.617686), (68.165409, 130.617686), (68.165409, 172.050021), (150.166906, 172.050021)], [(150.166906, 61.950021), (150.166906, 116.617686), (68.165409, 116.617686)], [(68.165409, 61.950021), (68.165409, 116.617686)], [(150.166906, 61.950021), (68.165409, 61.950021)], [(164.166906, 130.617686), (218.834571, 130.617686), (218.834571, 172.050021)], [(164.166906, 172.050021), (218.834571, 172.050021)], [(164.166906, 130.617686), (164.166906, 172.050021)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (150.1669, 172.05), (68.1654, 172.05), (109.1662, 161.05)), ('vertical', '50.5263', (150.1669, 130.6177), (150.1669, 172.05), (139.1669, 151.3339)), ('horizontal', '66.6667', (164.1669, 130.6177), (218.8346, 130.6177), (191.5008, 141.6177))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0057_00577279_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0057_00578952","images":["images/0057_00578952.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 4.16 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3589459956597258\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(201.4401, 132.529903), (201.4401, 121.117087), (65.912916, 131.103301), (65.912916, 132.529903), (201.4401, 132.529903)], [(201.4401, 101.470121), (201.4401, 107.117087)], [(65.912916, 101.470121), (65.912916, 107.117087), (201.4401, 107.117087)], [(65.912916, 101.470121), (201.4401, 101.470121)], [(221.087067, 121.117087), (215.4401, 121.117087), (215.4401, 131.103301)], [(221.087067, 131.103301), (215.4401, 131.103301)], [(221.087067, 121.117087), (221.087067, 131.103301)], [(215.4401, 131.103301), (215.4401, 132.529903)], [(221.087067, 132.529903), (215.4401, 132.529903)], [(221.087067, 131.103301), (221.087067, 132.529903)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '99.7296', (65.9129, 132.5299), (201.4401, 132.5299), (133.6765, 143.5299)), ('vertical', '1.0498', (65.9129, 131.1033), (65.9129, 132.5299), (54.9129, 131.8166)), ('vertical', '8.3983', (201.4401, 132.5299), (201.4401, 121.1171), (212.4401, 126.8235)), ('aligned', '100', (201.4401, 121.1171), (65.9129, 131.1033), (132.8682, 115.1399)), ('horizontal', '4.1554', (221.0871, 132.5299), (215.4401, 132.5299), (218.2636, 121.5299))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0057_00578952_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0059_00593040","images":["images/0059_00593040.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 35.79 mm tall. It is extruded to a thickness of 31.69 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.115768464730318\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(174.606859, 161.64798), (174.606859, 121.715214), (63.030012, 121.715214), (63.030012, 161.64798), (174.606859, 161.64798)], [(174.606859, 72.35206), (174.606859, 107.715214), (63.030012, 107.715214)], [(63.030012, 72.35206), (63.030012, 107.715214)], [(174.606859, 72.35206), (63.030012, 72.35206)], [(188.606859, 121.715214), (223.970012, 121.715214), (223.970012, 161.64798)], [(188.606859, 161.64798), (223.970012, 161.64798)], [(188.606859, 121.715214), (188.606859, 161.64798)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (174.6069, 161.648), (63.03, 161.648), (118.8184, 150.648)), ('vertical', '35.7895', (174.6069, 121.7152), (174.6069, 161.648), (163.6069, 141.6816)), ('horizontal', '31.694', (188.6068, 121.7152), (223.97, 121.7152), (206.2884, 132.7152))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0059_00593040_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0060_00600484","images":["images/0060_00600484.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 738.46 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.11461467889908454\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(99.911487, 172.049981), (99.911487, 160.588513), (88.450019, 160.588513), (88.450019, 172.049981), (99.911487, 172.049981)], [(99.911487, 61.949981), (99.911487, 146.588513), (88.450019, 146.588513)], [(88.450019, 61.949981), (88.450019, 146.588513)], [(99.911487, 61.949981), (88.450019, 61.949981)], [(113.911487, 160.588513), (198.550019, 160.588513), (198.550019, 172.049981)], [(113.911487, 172.049981), (198.550019, 172.049981)], [(113.911487, 160.588513), (113.911487, 172.049981)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (99.9115, 172.05), (88.45, 172.05), (94.1807, 161.05)), ('vertical', '100', (99.9115, 160.5885), (99.9115, 172.05), (88.9115, 166.3193)), ('horizontal', '738.462', (113.9115, 160.5885), (198.55, 160.5885), (156.2307, 171.5885))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0060_00600484_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0061_00613334","images":["images/0061_00613334.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 800 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.10677777777777778\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(99.127791, 172.049987), (99.127791, 161.372209), (88.450013, 161.372209), (88.450013, 172.049987), (99.127791, 172.049987)], [(99.127791, 61.949987), (99.127791, 147.372209), (88.450013, 147.372209)], [(88.450013, 61.949987), (88.450013, 147.372209)], [(99.127791, 61.949987), (88.450013, 61.949987)], [(113.127791, 161.372209), (198.550013, 161.372209), (198.550013, 172.049987)], [(113.127791, 172.049987), (198.550013, 172.049987)], [(113.127791, 161.372209), (113.127791, 172.049987)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (99.1278, 172.05), (88.45, 172.05), (93.7889, 161.05)), ('vertical', '100', (99.1278, 161.3722), (99.1278, 172.05), (88.1278, 166.7111)), ('horizontal', '800', (113.1278, 161.3722), (198.55, 161.3722), (155.8389, 172.3722))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0061_00613334_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0061_00614127","images":["images/0061_00614127.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 43.16 mm wide and 100 mm tall. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9413877551020436\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(155.833538, 77.911215), (155.833538, 172.04999), (115.205224, 172.04999), (115.205224, 77.911215), (155.833538, 77.911215)], [(155.833538, 63.911215), (155.833538, 61.94999)], [(115.205224, 63.911215), (115.205224, 61.94999), (155.833538, 61.94999)], [(115.205224, 63.911215), (155.833538, 63.911215)], [(171.794762, 172.04999), (169.833538, 172.04999), (169.833538, 77.911215)], [(171.794762, 77.911215), (169.833538, 77.911215)], [(171.794762, 172.04999), (171.794762, 77.911215)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '43.1579', (155.8335, 77.9112), (115.2052, 77.9112), (135.5194, 66.9112)), ('vertical', '100', (155.8335, 172.05), (155.8335, 77.9112), (166.8335, 124.9806)), ('horizontal', '2.0833', (171.7948, 172.05), (169.8336, 172.05), (170.8142, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0061_00614127_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0061_00614819","images":["images/0061_00614819.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 57.89 mm tall. It is extruded to a thickness of 2.81 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4292524590164344\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(205.955218, 167.380457), (205.955218, 84.634262), (63.029972, 84.634262), (63.029972, 167.380457), (205.955218, 167.380457)], [(205.955218, 66.619508), (205.955218, 70.634262), (63.029972, 70.634262)], [(63.029972, 66.619508), (63.029972, 70.634262)], [(205.955218, 66.619508), (63.029972, 66.619508)], [(219.955218, 84.634262), (223.969972, 84.634262), (223.969972, 167.380457)], [(219.955218, 167.380457), (223.969972, 167.380457)], [(219.955218, 84.634262), (219.955218, 167.380457)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (205.9552, 167.3804), (63.03, 167.3804), (134.4926, 156.3804)), ('vertical', '57.8947', (205.9552, 84.6343), (205.9552, 167.3804), (194.9552, 126.0073)), ('horizontal', '2.809', (219.9552, 84.6343), (223.97, 84.6343), (221.9626, 95.6343))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0061_00614819_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0061_00619484","images":["images/0061_00619484.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 80 mm tall. It is extruded to a thickness of 137.14 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4425657894736988\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(128.280908, 172.049978), (128.280908, 136.644715), (84.024329, 136.644715), (84.024329, 172.049978), (128.280908, 172.049978)], [(128.280908, 61.949978), (128.280908, 122.644715), (84.024329, 122.644715)], [(84.024329, 61.949978), (84.024329, 122.644715)], [(128.280908, 61.949978), (84.024329, 61.949978)], [(142.280908, 136.644715), (202.975645, 136.644715), (202.975645, 172.049978)], [(142.280908, 172.049978), (202.975645, 172.049978)], [(142.280908, 136.644715), (142.280908, 172.049978)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (128.2809, 172.05), (84.0243, 172.05), (106.1526, 161.05)), ('vertical', '80', (128.2809, 136.6447), (128.2809, 172.05), (117.2809, 154.3474)), ('horizontal', '137.143', (142.2809, 136.6447), (202.9757, 136.6447), (172.6283, 147.6447))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0061_00619484_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00620794","images":["images/0062_00620794.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 67.37 mm tall. It is extruded to a thickness of 10.94 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.2272379752153941\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(191.150416, 172.050031), (191.150416, 89.372946), (68.426619, 89.372946), (68.426619, 172.050031), (191.150416, 172.050031)], [(191.150416, 61.950031), (191.150416, 75.372946), (68.426619, 75.372946)], [(68.426619, 61.950031), (68.426619, 75.372946)], [(191.150416, 61.950031), (68.426619, 61.950031)], [(205.150416, 89.372946), (218.573332, 89.372946), (218.573332, 172.050031)], [(205.150416, 172.050031), (218.573332, 172.050031)], [(205.150416, 89.372946), (205.150416, 172.050031)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (191.1504, 172.0501), (68.4266, 172.0501), (129.7885, 161.0501)), ('vertical', '67.3684', (191.1504, 89.3729), (191.1504, 172.0501), (180.1504, 130.7115)), ('horizontal', '10.9375', (205.1504, 89.3729), (218.5734, 89.3729), (211.8619, 100.3729))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00620794_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00629403","images":["images/0062_00629403.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 12.63 mm tall. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3046074766355187\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(200.371423, 117.119329), (200.371423, 133.598581), (69.910675, 133.598581), (69.910675, 117.119329), (200.371423, 117.119329)], [(200.371423, 103.119329), (200.371423, 100.401396)], [(69.910675, 103.119329), (69.910675, 100.401396), (200.371423, 100.401396)], [(69.910675, 103.119329), (200.371423, 103.119329)], [(217.089355, 133.598581), (214.371423, 133.598581), (214.371423, 117.119329)], [(217.089355, 117.119329), (214.371423, 117.119329)], [(217.089355, 133.598581), (217.089355, 117.119329)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (200.3714, 117.1193), (69.9107, 117.1193), (135.141, 106.1193)), ('vertical', '12.6316', (200.3714, 133.5986), (200.3714, 117.1193), (211.3714, 125.359)), ('horizontal', '2.0833', (217.0893, 133.5986), (214.3715, 133.5986), (215.7304, 122.5986))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00629403_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0063_00630191","images":["images/0063_00630191.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 2.11 mm tall. It is extruded to a thickness of 6.25 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4391030927835013\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(203.957983, 126.982366), (203.957983, 130.012056), (60.047674, 130.012056), (60.047674, 126.982366), (203.957983, 126.982366)], [(203.957983, 112.982366), (203.957983, 103.987971)], [(60.047674, 112.982366), (60.047674, 103.987971), (203.957983, 103.987971)], [(60.047674, 112.982366), (203.957983, 112.982366)], [(226.952377, 130.012056), (217.957983, 130.012056), (217.957983, 126.982366)], [(226.952377, 126.982366), (217.957983, 126.982366)], [(226.952377, 130.012056), (226.952377, 126.982366)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (203.958, 126.9823), (60.0476, 126.9823), (132.0028, 115.9823)), ('vertical', '2.1053', (203.958, 130.0121), (203.958, 126.9823), (214.958, 128.4972)), ('horizontal', '6.25', (226.9524, 130.0121), (217.958, 130.0121), (222.4552, 119.0121))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0063_00630191_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0063_00631480","images":["images/0063_00631480.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 50.28 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6394758364313013\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(152.397593, 108.10241), (152.397593, 172.049993), (88.45001, 172.049993), (88.45001, 108.10241), (152.397593, 108.10241)], [(152.397593, 94.10241), (152.397593, 61.949993)], [(88.45001, 94.10241), (88.45001, 61.949993), (152.397593, 61.949993)], [(88.45001, 94.10241), (152.397593, 94.10241)], [(198.55001, 172.049993), (166.397593, 172.049993), (166.397593, 108.10241)], [(198.55001, 108.10241), (166.397593, 108.10241)], [(198.55001, 172.049993), (198.55001, 108.10241)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (152.3976, 108.1024), (88.45, 108.1024), (120.4238, 97.1024)), ('vertical', '100', (152.3976, 172.05), (152.3976, 108.1024), (163.3976, 140.0762)), ('horizontal', '50.2793', (198.55, 172.05), (166.3976, 172.05), (182.4738, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0063_00631480_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0064_00643417","images":["images/0064_00643417.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 14.58 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(167.877805, 92.6222), (167.877805, 166.0922), (94.407805, 166.0922), (94.407805, 92.6222), (167.877805, 92.6222)], [(167.877805, 78.6222), (167.877805, 67.907825)], [(94.407805, 78.6222), (94.407805, 67.907825), (167.877805, 67.907825)], [(94.407805, 78.6222), (167.877805, 78.6222)], [(192.59218, 166.0922), (181.877805, 166.0922), (181.877805, 92.6222)], [(192.59218, 92.6222), (181.877805, 92.6222)], [(192.59218, 166.0922), (192.59218, 92.6222)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (167.8778, 92.6222), (94.4078, 92.6222), (131.1428, 81.6222)), ('vertical', '100', (167.8778, 166.0922), (167.8778, 92.6222), (178.8778, 129.3572)), ('horizontal', '14.5833', (192.5922, 166.0922), (181.8778, 166.0922), (187.235, 155.0922))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0064_00643417_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0064_00646697","images":["images/0064_00646697.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 60 mm tall. It is extruded to a thickness of 50 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8736363636363637\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(158.340904, 172.049989), (158.340904, 119.631807), (70.977267, 119.631807), (70.977267, 172.049989), (158.340904, 172.049989)], [(158.340904, 61.949989), (158.340904, 105.631807), (70.977267, 105.631807)], [(70.977267, 61.949989), (70.977267, 105.631807)], [(158.340904, 61.949989), (70.977267, 61.949989)], [(172.340904, 119.631807), (216.022722, 119.631807), (216.022722, 172.049989)], [(172.340904, 172.049989), (216.022722, 172.049989)], [(172.340904, 119.631807), (172.340904, 172.049989)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (158.3409, 172.05), (70.9773, 172.05), (114.6591, 161.05)), ('vertical', '60', (158.3409, 119.6318), (158.3409, 172.05), (147.3409, 145.8409)), ('horizontal', '50', (172.3409, 119.6318), (216.0227, 119.6318), (194.1818, 130.6318))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0064_00646697_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0065_00651128","images":["images/0065_00651128.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 74.74 mm tall. It is extruded to a thickness of 37.5 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.856225087924972\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(163.257014, 172.049976), (163.257014, 108.058416), (77.634505, 108.058416), (77.634505, 172.049976), (163.257014, 172.049976)], [(163.257014, 61.949976), (163.257014, 94.058416), (77.634505, 94.058416)], [(77.634505, 61.949976), (77.634505, 94.058416)], [(163.257014, 61.949976), (77.634505, 61.949976)], [(177.257014, 108.058416), (209.365454, 108.058416), (209.365454, 172.049976)], [(177.257014, 172.049976), (209.365454, 172.049976)], [(177.257014, 108.058416), (177.257014, 172.049976)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (163.257, 172.05), (77.6345, 172.05), (120.4458, 161.05)), ('vertical', '74.7368', (163.257, 108.0584), (163.257, 172.05), (152.257, 140.0542)), ('horizontal', '37.5', (177.257, 108.0584), (209.3655, 108.0584), (193.3113, 119.0584))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0065_00651128_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0065_00655716","images":["images/0065_00655716.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 1.05 mm tall. It is extruded to a thickness of 1.04 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4542515463917478\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(208.455182, 125.522795), (208.455182, 123.992004), (63.030027, 123.992004), (63.030027, 125.522795), (208.455182, 125.522795)], [(208.455182, 108.477158), (208.455182, 109.992004), (63.030027, 109.992004)], [(63.030027, 108.477158), (63.030027, 109.992004)], [(208.455182, 108.477158), (63.030027, 108.477158)], [(222.455182, 123.992004), (223.970027, 123.992004), (223.970027, 125.522795)], [(222.455182, 125.522795), (223.970027, 125.522795)], [(222.455182, 123.992004), (222.455182, 125.522795)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (208.4552, 125.5228), (63.03, 125.5228), (135.7426, 114.5228)), ('vertical', '1.0526', (208.4552, 123.992), (208.4552, 125.5228), (197.4552, 124.7574)), ('horizontal', '1.0417', (222.4552, 123.992), (223.97, 123.992), (223.2126, 134.992))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0065_00655716_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0070_00701175","images":["images/0070_00701175.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 62.11 mm tall. It is extruded to a thickness of 0.78 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4580093023255813\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(208.830892, 169.844571), (208.830892, 79.294519), (63.029962, 79.294519), (63.029962, 169.844571), (208.830892, 169.844571)], [(208.830892, 64.15545), (208.830892, 65.294519), (63.029962, 65.294519)], [(63.029962, 64.15545), (63.029962, 65.294519)], [(208.830892, 64.15545), (63.029962, 64.15545)], [(222.830892, 79.294519), (223.969962, 79.294519), (223.969962, 169.844571)], [(222.830892, 169.844571), (223.969962, 169.844571)], [(222.830892, 79.294519), (222.830892, 169.844571)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (208.8309, 169.8446), (63.03, 169.8446), (135.9305, 158.8446)), ('vertical', '62.1053', (208.8309, 79.2945), (208.8309, 169.8446), (197.8309, 124.5696)), ('horizontal', '0.7812', (222.8309, 79.2945), (223.9699, 79.2945), (223.4004, 90.2945))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0070_00701175_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0070_00703258","images":["images/0070_00703258.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 80 mm tall. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1707614213199014\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(193.818511, 172.049948), (193.818511, 78.389035), (76.742369, 78.389035), (76.742369, 172.049948), (193.818511, 172.049948)], [(193.818511, 61.949948), (193.818511, 64.389035), (76.742369, 64.389035)], [(76.742369, 61.949948), (76.742369, 64.389035)], [(193.818511, 61.949948), (76.742369, 61.949948)], [(207.818511, 78.389035), (210.257597, 78.389035), (210.257597, 172.049948)], [(207.818511, 172.049948), (210.257597, 172.049948)], [(207.818511, 78.389035), (207.818511, 172.049948)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (193.8185, 172.05), (76.7424, 172.05), (135.2805, 161.05)), ('vertical', '80', (193.8185, 78.389), (193.8185, 172.05), (182.8185, 125.2195)), ('horizontal', '2.0833', (207.8185, 78.389), (210.2576, 78.389), (209.0381, 89.389))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0070_00703258_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0071_00712057","images":["images/0071_00712057.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 91.58 mm tall. It is extruded to a thickness of 33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7693398876404518\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.144685, 172.050022), (162.144685, 101.594685), (85.210696, 101.594685), (85.210696, 172.050022), (162.144685, 172.050022)], [(162.144685, 61.950022), (162.144685, 87.594685), (85.210696, 87.594685)], [(85.210696, 61.950022), (85.210696, 87.594685)], [(162.144685, 61.950022), (85.210696, 61.950022)], [(176.144685, 101.594685), (201.789348, 101.594685), (201.789348, 172.050022)], [(176.144685, 172.050022), (201.789348, 172.050022)], [(176.144685, 101.594685), (176.144685, 172.050022)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (162.1447, 172.05), (85.2107, 172.05), (123.6777, 161.05)), ('vertical', '91.5789', (162.1447, 101.5947), (162.1447, 172.05), (151.1447, 136.8223)), ('horizontal', '33.3333', (176.1447, 101.5947), (201.7893, 101.5947), (188.967, 112.5947))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0071_00712057_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0071_00715415","images":["images/0071_00715415.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 12.63 mm tall. It is extruded to a thickness of 5.88 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3046074766355422\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(197.893277, 119.597469), (197.893277, 136.076721), (67.43253, 136.076721), (67.43253, 119.597469), (197.893277, 119.597469)], [(197.893277, 105.597469), (197.893277, 97.923307)], [(67.43253, 105.597469), (67.43253, 97.923307), (197.893277, 97.923307)], [(67.43253, 105.597469), (197.893277, 105.597469)], [(219.567439, 136.076721), (211.893277, 136.076721), (211.893277, 119.597469)], [(219.567439, 119.597469), (211.893277, 119.597469)], [(219.567439, 136.076721), (219.567439, 119.597469)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (197.8933, 119.5975), (67.4325, 119.5975), (132.6629, 108.5975)), ('vertical', '12.6316', (197.8933, 136.0767), (197.8933, 119.5975), (208.8933, 127.8371)), ('horizontal', '5.8824', (219.5675, 136.0767), (211.8932, 136.0767), (215.7303, 125.0767))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0071_00715415_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0071_00715744","images":["images/0071_00715744.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 8.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8870769230769259\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(177.157697, 172.049995), (177.157697, 83.342303), (88.450005, 83.342303), (88.450005, 172.049995), (177.157697, 172.049995)], [(177.157697, 61.949995), (177.157697, 69.342303), (88.450005, 69.342303)], [(88.450005, 61.949995), (88.450005, 69.342303)], [(177.157697, 61.949995), (88.450005, 61.949995)], [(191.157697, 83.342303), (198.550005, 83.342303), (198.550005, 172.049995)], [(191.157697, 172.049995), (198.550005, 172.049995)], [(191.157697, 83.342303), (191.157697, 172.049995)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (177.1577, 172.05), (88.45, 172.05), (132.8038, 161.05)), ('vertical', '100', (177.1577, 83.3423), (177.1577, 172.05), (166.1577, 127.6962)), ('horizontal', '8.3333', (191.1577, 83.3423), (198.55, 83.3423), (194.8538, 94.3423))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0071_00715744_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0073_00732275","images":["images/0073_00732275.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.480500000000024\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.5, 124.0), (136.5, 172.05), (88.45, 172.05), (88.45, 124.0), (136.5, 124.0)], [(136.5, 110.0), (136.5, 61.95), (88.45, 61.95)], [(88.45, 110.0), (88.45, 61.95)], [(136.5, 110.0), (88.45, 110.0)], [(150.5, 172.05), (198.55, 172.05), (198.55, 124.0)], [(150.5, 124.0), (198.55, 124.0)], [(150.5, 172.05), (150.5, 124.0)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)), ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)), ('horizontal', '100', (150.5, 124.0), (198.55, 124.0), (174.525, 135.0))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0073_00732275_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0074_00745345","images":["images/0074_00745345.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 7.37 mm tall. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4394122448979638\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(206.97121, 130.802497), (206.97121, 120.196302), (63.029985, 120.196302), (63.029985, 130.802497), (206.97121, 130.802497)], [(206.97121, 103.197526), (206.97121, 106.196302), (63.029985, 106.196302)], [(63.029985, 103.197526), (63.029985, 106.196302)], [(206.97121, 103.197526), (63.029985, 103.197526)], [(220.97121, 120.196302), (223.969985, 120.196302), (223.969985, 130.802497)], [(220.97121, 130.802497), (223.969985, 130.802497)], [(220.97121, 120.196302), (220.97121, 130.802497)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (206.9712, 130.8025), (63.03, 130.8025), (135.0006, 119.8025)), ('vertical', '7.3684', (206.9712, 120.1963), (206.9712, 130.8025), (195.9712, 125.4994)), ('horizontal', '2.0833', (220.9712, 120.1963), (223.97, 120.1963), (222.4706, 131.1963))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0074_00745345_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0074_00748311","images":["images/0074_00748311.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 12.63 mm tall. It is extruded to a thickness of 223.26 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4073977791616294\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(111.392931, 166.903914), (111.392931, 172.049991), (70.653153, 172.049991), (70.653153, 166.903914), (111.392931, 166.903914)], [(111.392931, 152.903914), (111.392931, 61.949991)], [(70.653153, 152.903914), (70.653153, 61.949991), (111.392931, 61.949991)], [(70.653153, 152.903914), (111.392931, 152.903914)], [(216.346854, 172.049991), (125.392931, 172.049991), (125.392931, 166.903914)], [(216.346854, 166.903914), (125.392931, 166.903914)], [(216.346854, 172.049991), (216.346854, 166.903914)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (111.3929, 166.9039), (70.6532, 166.9039), (91.023, 155.9039)), ('vertical', '12.6316', (111.3929, 172.05), (111.3929, 166.9039), (122.3929, 169.477)), ('horizontal', '223.256', (216.3469, 172.05), (125.3929, 172.05), (170.8699, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0074_00748311_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0074_00748378","images":["images/0074_00748378.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 74.74 mm tall. It is extruded to a thickness of 33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8409216867470415\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(164.530709, 106.591441), (164.530709, 169.439273), (80.43854, 169.439273), (80.43854, 106.591441), (164.530709, 106.591441)], [(164.530709, 92.591441), (164.530709, 64.560718)], [(80.43854, 92.591441), (80.43854, 64.560718), (164.530709, 64.560718)], [(80.43854, 92.591441), (164.530709, 92.591441)], [(206.561432, 169.439273), (178.530709, 169.439273), (178.530709, 106.591441)], [(206.561432, 106.591441), (178.530709, 106.591441)], [(206.561432, 169.439273), (206.561432, 106.591441)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (164.5307, 106.5914), (80.4385, 106.5914), (122.4846, 95.5914)), ('vertical', '74.7368', (164.5307, 169.4393), (164.5307, 106.5914), (175.5307, 138.0154)), ('horizontal', '33.3333', (206.5614, 169.4393), (178.5308, 169.4393), (192.5461, 158.4393))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0074_00748378_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0076_00761423","images":["images/0076_00761423.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 1.17 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9498901734104125\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(183.439007, 172.05001), (183.439007, 77.060993), (88.44999, 77.060993), (88.44999, 172.05001), (183.439007, 172.05001)], [(183.439007, 61.95001), (183.439007, 63.060993), (88.44999, 63.060993)], [(88.44999, 61.95001), (88.44999, 63.060993)], [(183.439007, 61.95001), (88.44999, 61.95001)], [(197.439007, 77.060993), (198.54999, 77.060993), (198.54999, 172.05001)], [(197.439007, 172.05001), (198.54999, 172.05001)], [(197.439007, 77.060993), (197.439007, 172.05001)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (183.439, 172.05), (88.45, 172.05), (135.9445, 161.05)), ('vertical', '100', (183.439, 77.061), (183.439, 172.05), (172.439, 124.5555)), ('horizontal', '1.1696', (197.439, 77.061), (198.55, 77.061), (197.9945, 88.061))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0076_00761423_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0077_00770788","images":["images/0077_00770788.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 83.16 mm tall. It is extruded to a thickness of 66.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.641416861826727\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(147.190292, 118.711114), (147.190292, 172.04999), (83.048606, 172.04999), (83.048606, 118.711114), (147.190292, 118.711114)], [(147.190292, 104.711114), (147.190292, 61.94999)], [(83.048606, 104.711114), (83.048606, 61.94999), (147.190292, 61.94999)], [(83.048606, 104.711114), (147.190292, 104.711114)], [(203.951417, 172.04999), (161.190292, 172.04999), (161.190292, 118.711114)], [(203.951417, 118.711114), (161.190292, 118.711114)], [(203.951417, 172.04999), (203.951417, 118.711114)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (147.1903, 118.7111), (83.0486, 118.7111), (115.1194, 107.7111)), ('vertical', '83.1579', (147.1903, 172.05), (147.1903, 118.7111), (158.1903, 145.3806)), ('horizontal', '66.6667', (203.9514, 172.05), (161.1903, 172.05), (182.5708, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0077_00770788_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0079_00794236","images":["images/0079_00794236.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 64.21 mm tall. It is extruded to a thickness of 0.54 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8948269230769528\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(181.000801, 95.511895), (181.000801, 152.969203), (91.518108, 152.969203), (91.518108, 95.511895), (181.000801, 95.511895)], [(181.000801, 81.511895), (181.000801, 81.030806)], [(91.518108, 81.511895), (91.518108, 81.030806), (181.000801, 81.030806)], [(91.518108, 81.511895), (181.000801, 81.511895)], [(195.48189, 152.969203), (195.000801, 152.969203), (195.000801, 95.511895)], [(195.48189, 95.511895), (195.000801, 95.511895)], [(195.48189, 152.969203), (195.48189, 95.511895)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (181.0008, 95.5119), (91.5181, 95.5119), (136.2595, 84.5119)), ('vertical', '64.2105', (181.0008, 152.9692), (181.0008, 95.5119), (192.0008, 124.2405)), ('vertical', '0.5376', (195.4819, 152.9692), (195.0008, 152.9692), (195.2414, 141.9692))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0079_00794236_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0079_00796765","images":["images/0079_00796765.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 42.11 mm tall. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.0340222222222493\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(187.124002, 103.308213), (187.124002, 146.845991), (83.72178, 146.845991), (83.72178, 103.308213), (187.124002, 103.308213)], [(187.124002, 89.308213), (187.124002, 87.154)], [(83.72178, 89.308213), (83.72178, 87.154), (187.124002, 87.154)], [(83.72178, 89.308213), (187.124002, 89.308213)], [(203.278215, 146.845991), (201.124002, 146.845991), (201.124002, 103.308213)], [(203.278215, 103.308213), (201.124002, 103.308213)], [(203.278215, 146.845991), (203.278215, 103.308213)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (187.124, 103.3082), (83.7218, 103.3082), (135.4229, 92.3082)), ('vertical', '42.1053', (187.124, 146.846), (187.124, 103.3082), (198.124, 125.0771)), ('horizontal', '2.0833', (203.2782, 146.846), (201.124, 146.846), (202.2011, 135.846))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0079_00796765_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00825297","images":["images/0082_00825297.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 41.05 mm tall. It is extruded to a thickness of 12.96 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3007803278688634\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(193.108073, 159.131213), (193.108073, 105.730758), (63.03004, 105.730758), (63.03004, 159.131213), (193.108073, 159.131213)], [(193.108073, 74.868791), (193.108073, 91.730758), (63.03004, 91.730758)], [(63.03004, 74.868791), (63.03004, 91.730758)], [(193.108073, 74.868791), (63.03004, 74.868791)], [(207.108073, 105.730758), (223.97004, 105.730758), (223.97004, 159.131213)], [(207.108073, 159.131213), (223.97004, 159.131213)], [(207.108073, 105.730758), (207.108073, 159.131213)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (193.1081, 159.1313), (63.0301, 159.1313), (128.0691, 148.1313)), ('vertical', '41.0526', (193.1081, 105.7307), (193.1081, 159.1313), (182.1081, 132.431)), ('horizontal', '12.963', (207.108, 105.7307), (223.97, 105.7307), (215.539, 116.7307))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00825297_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0083_00834954","images":["images/0083_00834954.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 92.63 mm wide and 100 mm tall. It is extruded to a thickness of 1.56 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9462153846153847\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(179.585473, 172.050023), (179.585473, 77.428485), (91.936048, 77.428485), (91.936048, 172.050023), (179.585473, 172.050023)], [(179.585473, 61.950023), (179.585473, 63.428485), (91.936048, 63.428485)], [(91.936048, 61.950023), (91.936048, 63.428485)], [(179.585473, 61.950023), (91.936048, 61.950023)], [(193.585473, 77.428485), (195.063934, 77.428485), (195.063934, 172.050023)], [(193.585473, 172.050023), (195.063934, 172.050023)], [(193.585473, 77.428485), (193.585473, 172.050023)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '92.6316', (179.5855, 172.05), (91.936, 172.05), (135.7607, 161.05)), ('vertical', '100', (179.5855, 77.4285), (179.5855, 172.05), (168.5855, 124.7392)), ('horizontal', '1.5625', (193.5855, 77.4285), (195.0639, 77.4285), (194.3247, 88.4285))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0083_00834954_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0084_00846479","images":["images/0084_00846479.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 83.16 mm wide and 100 mm tall. It is extruded to a thickness of 8.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8022586206896556\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(163.171572, 90.572563), (163.171572, 170.798425)], [(96.457434, 90.572563), (163.171572, 90.572563)], [(163.171572, 170.798425), (96.457434, 170.798425), (96.457434, 90.572563)], [(163.171572, 63.201586), (163.171572, 76.572563)], [(96.457434, 63.201586), (96.457434, 76.572563)], [(96.457434, 63.201586), (163.171572, 63.201586)], [(96.457434, 76.572563), (163.171572, 76.572563)], [(177.171572, 90.572563), (190.542549, 90.572563)], [(190.542549, 170.798425), (177.171572, 170.798425), (177.171572, 90.572563)], [(190.542549, 170.798425), (190.542549, 90.572563)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '83.1579', (163.1716, 90.5726), (96.4574, 90.5726), (129.8145, 79.5726)), ('vertical', '100', (163.1716, 170.7984), (163.1716, 90.5726), (174.1716, 130.6855)), ('horizontal', '16.6667', (190.5425, 170.7984), (177.1716, 170.7984), (183.8571, 159.7984))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0084_00846479_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0086_00865806","images":["images/0086_00865806.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 51.58 mm wide and 100 mm tall. It is extruded to a thickness of 355.56 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.2109512195122019\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(104.437893, 172.050013), (104.437893, 150.954891), (93.557251, 150.954891), (93.557251, 172.050013), (104.437893, 172.050013)], [(104.437893, 61.950013), (104.437893, 136.954891), (93.557251, 136.954891)], [(93.557251, 61.950013), (93.557251, 136.954891)], [(104.437893, 61.950013), (93.557251, 61.950013)], [(118.437893, 150.954891), (193.442771, 150.954891), (193.442771, 172.050013)], [(118.437893, 172.050013), (193.442771, 172.050013)], [(118.437893, 150.954891), (118.437893, 172.050013)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '51.5789', (104.4379, 172.05), (93.5572, 172.05), (98.9976, 161.05)), ('vertical', '100', (104.4379, 150.9549), (104.4379, 172.05), (93.4379, 161.5024)), ('horizontal', '355.556', (118.4379, 150.9549), (193.4428, 150.9549), (155.9403, 161.9549))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0086_00865806_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0087_00875126","images":["images/0087_00875126.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 2.11 mm wide and 100 mm tall. It is extruded to a thickness of -9.38 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8786285714285713\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(133.3063, 172.049974), (133.3063, 84.187117), (131.456556, 84.187117), (131.456556, 172.049974), (133.3063, 172.049974)], [(133.3063, 70.187117), (133.3063, 61.949974), (131.456556, 61.949974)], [(131.456556, 70.187117), (131.456556, 61.949974)], [(133.3063, 70.187117), (131.456556, 70.187117)], [(155.543443, 84.187117), (147.3063, 84.187117), (147.3063, 172.049974)], [(155.543443, 172.049974), (147.3063, 172.049974)], [(155.543443, 84.187117), (155.543443, 172.049974)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '2.1053', (133.3063, 172.05), (131.4566, 172.05), (132.3814, 161.05)), ('vertical', '100', (133.3063, 84.1871), (133.3063, 172.05), (122.3063, 128.1186)), ('horizontal', '9.375', (155.5434, 84.1871), (147.3063, 84.1871), (151.4249, 73.1871))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0087_00875126_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0088_00882815","images":["images/0088_00882815.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 31.58 mm tall. It is extruded to a thickness of 33.51 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1167440000000344\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(173.627301, 125.07704), (173.627301, 160.34264), (61.952901, 160.34264), (61.952901, 125.07704), (173.627301, 125.07704)], [(173.627301, 111.07704), (173.627301, 73.657346)], [(61.952901, 111.07704), (61.952901, 73.657346), (173.627301, 73.657346)], [(61.952901, 111.07704), (173.627301, 111.07704)], [(225.046995, 160.34264), (187.627301, 160.34264), (187.627301, 125.07704)], [(225.046995, 125.07704), (187.627301, 125.07704)], [(225.046995, 160.34264), (225.046995, 125.07704)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (173.6273, 125.0771), (61.9529, 125.0771), (117.7901, 114.0771)), ('vertical', '31.5789', (173.6273, 160.3426), (173.6273, 125.0771), (184.6273, 142.7099)), ('horizontal', '33.5079', (225.047, 160.3426), (187.6273, 160.3426), (206.3372, 149.3426))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0088_00882815_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0089_00895076","images":["images/0089_00895076.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 84.21 mm tall. It is extruded to a thickness of 5.78 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.067886071670127\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(186.807891, 172.050029), (186.807891, 82.122781), (80.019284, 82.122781), (80.019284, 172.050029), (186.807891, 172.050029)], [(186.807891, 61.950029), (186.807891, 68.122781), (80.019284, 68.122781)], [(80.019284, 61.950029), (80.019284, 68.122781)], [(186.807891, 61.950029), (80.019284, 61.950029)], [(200.807891, 82.122781), (206.980643, 82.122781), (206.980643, 172.050029)], [(200.807891, 172.050029), (206.980643, 172.050029)], [(200.807891, 82.122781), (200.807891, 172.050029)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (186.8079, 172.05), (80.0193, 172.05), (133.4136, 161.05)), ('vertical', '84.2105', (186.8079, 82.1228), (186.8079, 172.05), (175.8079, 127.0864)), ('horizontal', '5.7803', (200.8079, 82.1228), (206.9806, 82.1228), (203.8943, 93.1228))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0089_00895076_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0092_00927567","images":["images/0092_00927567.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 73.68 mm tall. It is extruded to a thickness of -100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5533030303030423\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(114.412099, 183.918802), (114.412099, 128.588499), (73.642402, 128.588499)], [(73.642402, 183.918802), (73.642402, 128.588499)], [(114.412099, 183.918802), (73.642402, 183.918802)], [(183.742402, 253.249105), (128.412099, 253.249105)], [(183.742402, 197.918802), (128.412099, 197.918802), (128.412099, 253.249105)], [(183.742402, 197.918802), (183.742402, 253.249105)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '100', (114.4121, 128.5885), (114.4121, 183.9188), (103.4121, 156.2536)), ('horizontal', '73.6842', (73.6424, 128.5885), (114.4121, 128.5885), (94.0273, 139.5885)), ('vertical', '100', (73.6424, 50.0812), (73.6424, 105.4115), (62.6424, 77.7464))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0092_00927567_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0093_00937357","images":["images/0093_00937357.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 40 mm tall. It is extruded to a thickness of 40 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6864285714285715\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(91.907138, 61.949971), (91.907138, 89.407114), (64.449995, 89.407114)], [(64.449995, 61.949971), (64.449995, 89.407114)], [(91.907138, 61.949971), (64.449995, 61.949971)], [(105.907138, 172.049971), (133.364281, 172.049971)], [(105.907138, 103.407114), (133.364281, 103.407114), (133.364281, 172.049971)], [(105.907138, 103.407114), (105.907138, 172.049971)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '100', (133.3643, 103.4071), (133.3643, 172.05), (122.3643, 137.7286)), ('horizontal', '40', (105.9071, 103.4071), (133.3643, 103.4071), (119.6357, 114.4071)), ('vertical', '40', (105.9071, 89.4071), (105.9071, 61.95), (116.9071, 75.6786))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0093_00937357_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0095_00957038","images":["images/0095_00957038.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 68.42 mm tall. It is extruded to a thickness of 143.28 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.45393432282004176\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(126.676019, 172.049979), (126.676019, 140.991314), (81.282587, 140.991314), (81.282587, 172.049979), (126.676019, 172.049979)], [(126.676019, 61.949979), (126.676019, 126.991314), (81.282587, 126.991314)], [(81.282587, 61.949979), (81.282587, 126.991314)], [(126.676019, 61.949979), (81.282587, 61.949979)], [(140.676019, 140.991314), (205.717355, 140.991314), (205.717355, 172.049979)], [(140.676019, 172.049979), (205.717355, 172.049979)], [(140.676019, 140.991314), (140.676019, 172.049979)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (126.676, 172.05), (81.2826, 172.05), (103.9793, 161.05)), ('vertical', '68.4211', (126.676, 140.9913), (126.676, 172.05), (115.676, 156.5207)), ('horizontal', '143.284', (140.676, 140.9913), (205.7174, 140.9913), (173.1967, 151.9913))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0095_00957038_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0095_00959629","images":["images/0095_00959629.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 738.46 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1146146788990848\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(99.911487, 172.049981), (99.911487, 160.588513), (88.450019, 160.588513), (88.450019, 172.049981), (99.911487, 172.049981)], [(99.911487, 61.949981), (99.911487, 146.588513), (88.450019, 146.588513)], [(88.450019, 61.949981), (88.450019, 146.588513)], [(99.911487, 61.949981), (88.450019, 61.949981)], [(113.911487, 160.588513), (198.550019, 160.588513), (198.550019, 172.049981)], [(113.911487, 172.049981), (198.550019, 172.049981)], [(113.911487, 160.588513), (113.911487, 172.049981)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (99.9115, 172.05), (88.45, 172.05), (94.1807, 161.05)), ('vertical', '100', (99.9115, 160.5885), (99.9115, 172.05), (88.9115, 166.3193)), ('horizontal', '738.462', (113.9115, 160.5885), (198.55, 160.5885), (156.2307, 171.5885))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0095_00959629_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0097_00977478","images":["images/0097_00977478.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 27.37 mm wide and 100 mm tall. It is extruded to a thickness of 1600 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.05652941176470588\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(92.050012, 166.397075), (92.050012, 172.050016), (90.502892, 172.050016), (90.502892, 166.397075), (92.050012, 166.397075)], [(92.050012, 152.397075), (92.050012, 61.950016)], [(90.502892, 152.397075), (90.502892, 61.950016), (92.050012, 61.950016)], [(90.502892, 152.397075), (92.050012, 152.397075)], [(196.497071, 172.050016), (106.050012, 172.050016), (106.050012, 166.397075)], [(196.497071, 166.397075), (106.050012, 166.397075)], [(196.497071, 172.050016), (196.497071, 166.397075)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '27.3684', (92.05, 166.3971), (90.5029, 166.3971), (91.2765, 155.3971)), ('vertical', '100', (92.05, 172.05), (92.05, 166.3971), (103.05, 169.2235)), ('horizontal', '1600', (196.4971, 172.05), (106.05, 172.05), (151.2736, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0097_00977478_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0004_00047566","images":["images/0004_00047566.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 49.48 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6428989547038615\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(72.377552, 109.832552), (74.386611, 109.832552), (76.395671, 109.832552), (78.40473, 109.832552), (80.413789, 109.832552), (82.422848, 109.832552), (84.431908, 109.832552), (86.440967, 109.832552), (88.450026, 109.832552), (90.459085, 109.832552), (92.468145, 109.832552), (94.477204, 109.832552), (96.486263, 109.832552), (98.495322, 109.832552), (100.504382, 109.832552), (102.513441, 109.832552), (104.5225, 109.832552), (106.531559, 109.832552), (108.540618, 109.832552), (110.549678, 109.832552), (112.558737, 109.832552), (114.567796, 109.832552), (116.576855, 109.832552), (118.585915, 109.832552), (120.594974, 109.832552), (122.604033, 109.832552), (124.613092, 109.832552), (126.622152, 109.832552), (128.631211, 109.832552), (130.64027, 109.832552), (132.649329, 109.832552), (134.658389, 109.832552), (136.667448, 109.832552), (136.667448, 78.022448)], [(72.377552, 78.022448), (74.386611, 78.022448), (76.395671, 78.022448), (78.40473, 78.022448), (80.413789, 78.022448), (82.422848, 78.022448), (84.431908, 78.022448), (86.440967, 78.022448), (88.450026, 78.022448), (90.459085, 78.022448), (92.468145, 78.022448), (94.477204, 78.022448), (96.486263, 78.022448), (98.495322, 78.022448), (100.504382, 78.022448), (102.513441, 78.022448), (104.5225, 78.022448), (106.531559, 78.022448), (108.540618, 78.022448), (110.549678, 78.022448), (112.558737, 78.022448), (114.567796, 78.022448), (116.576855, 78.022448), (118.585915, 78.022448), (120.594974, 78.022448), (122.604033, 78.022448), (124.613092, 78.022448), (126.622152, 78.022448), (128.631211, 78.022448), (130.64027, 78.022448), (132.649329, 78.022448), (134.658389, 78.022448), (136.667448, 78.022448)], [(72.377552, 78.022448), (72.377552, 109.832552)], [(182.477552, 188.122448), (182.477552, 186.113389), (182.477552, 184.104329), (182.477552, 182.09527), (182.477552, 180.086211), (182.477552, 178.077152), (182.477552, 176.068092), (182.477552, 174.059033), (182.477552, 172.049974), (182.477552, 170.040915), (182.477552, 168.031855), (182.477552, 166.022796), (182.477552, 164.013737), (182.477552, 162.004678), (182.477552, 159.995618), (182.477552, 157.986559), (182.477552, 155.9775), (182.477552, 153.968441), (182.477552, 151.959382), (182.477552, 149.950322), (182.477552, 147.941263), (182.477552, 145.932204), (182.477552, 143.923145), (182.477552, 141.914085), (182.477552, 139.905026), (182.477552, 137.895967), (182.477552, 135.886908), (182.477552, 133.877848), (182.477552, 131.868789), (182.477552, 129.85973), (182.477552, 127.850671), (182.477552, 125.841611), (182.477552, 123.832552)], [(150.667448, 188.122448), (150.667448, 186.113389), (150.667448, 184.104329), (150.667448, 182.09527), (150.667448, 180.086211), (150.667448, 178.077152), (150.667448, 176.068092), (150.667448, 174.059033), (150.667448, 172.049974), (150.667448, 170.040915), (150.667448, 168.031855), (150.667448, 166.022796), (150.667448, 164.013737), (150.667448, 162.004678), (150.667448, 159.995618), (150.667448, 157.986559), (150.667448, 155.9775), (150.667448, 153.968441), (150.667448, 151.959382), (150.667448, 149.950322), (150.667448, 147.941263), (150.667448, 145.932204), (150.667448, 143.923145), (150.667448, 141.914085), (150.667448, 139.905026), (150.667448, 137.895967), (150.667448, 135.886908), (150.667448, 133.877848), (150.667448, 131.868789), (150.667448, 129.85973), (150.667448, 127.850671), (150.667448, 125.841611), (150.667448, 123.832552)], [(150.667448, 188.122448), (182.477552, 188.122448)], [(150.667448, 123.832552), (182.477552, 123.832552)]])\nVISIBLE_CIRCLES = [(104.5225, 155.9775, 32.144948)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45), ('horizontal', '49.4792', (182.4775, 155.9775), (150.6674, 155.9775), (166.5725, 144.9775))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0004_00047566_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0010_00107752","images":["images/0010_00107752.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 98.96 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4830157068062908\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(76.374615, 121.823814), (77.884039, 121.823814), (79.393463, 121.823814), (80.902887, 121.823814), (82.412311, 121.823814), (83.921735, 121.823814), (85.431159, 121.823814), (86.940583, 121.823814), (88.450007, 121.823814), (89.959431, 121.823814), (91.468855, 121.823814), (92.97828, 121.823814), (94.487704, 121.823814), (95.997128, 121.823814), (97.506552, 121.823814), (99.015976, 121.823814), (100.5254, 121.823814), (102.034824, 121.823814), (103.544248, 121.823814), (105.053672, 121.823814), (106.563096, 121.823814), (108.07252, 121.823814), (109.581945, 121.823814), (111.091369, 121.823814), (112.600793, 121.823814), (114.110217, 121.823814), (115.619641, 121.823814), (117.129065, 121.823814), (118.638489, 121.823814), (120.147913, 121.823814), (121.657337, 121.823814), (123.166761, 121.823814), (124.676185, 121.823814), (124.676185, 74.025385)], [(76.374615, 74.025385), (77.884039, 74.025385), (79.393463, 74.025385), (80.902887, 74.025385), (82.412311, 74.025385), (83.921735, 74.025385), (85.431159, 74.025385), (86.940583, 74.025385), (88.450007, 74.025385), (89.959431, 74.025385), (91.468855, 74.025385), (92.97828, 74.025385), (94.487704, 74.025385), (95.997128, 74.025385), (97.506552, 74.025385), (99.015976, 74.025385), (100.5254, 74.025385), (102.034824, 74.025385), (103.544248, 74.025385), (105.053672, 74.025385), (106.563096, 74.025385), (108.07252, 74.025385), (109.581945, 74.025385), (111.091369, 74.025385), (112.600793, 74.025385), (114.110217, 74.025385), (115.619641, 74.025385), (117.129065, 74.025385), (118.638489, 74.025385), (120.147913, 74.025385), (121.657337, 74.025385), (123.166761, 74.025385), (124.676185, 74.025385)], [(76.374615, 74.025385), (76.374615, 121.823814)], [(186.474615, 184.125385), (186.474615, 182.615961), (186.474615, 181.106537), (186.474615, 179.597113), (186.474615, 178.087689), (186.474615, 176.578265), (186.474615, 175.068841), (186.474615, 173.559417), (186.474615, 172.049993), (186.474615, 170.540569), (186.474615, 169.031145), (186.474615, 167.52172), (186.474615, 166.012296), (186.474615, 164.502872), (186.474615, 162.993448), (186.474615, 161.484024), (186.474615, 159.9746), (186.474615, 158.465176), (186.474615, 156.955752), (186.474615, 155.446328), (186.474615, 153.936904), (186.474615, 152.42748), (186.474615, 150.918055), (186.474615, 149.408631), (186.474615, 147.899207), (186.474615, 146.389783), (186.474615, 144.880359), (186.474615, 143.370935), (186.474615, 141.861511), (186.474615, 140.352087), (186.474615, 138.842663), (186.474615, 137.333239), (186.474615, 135.823815)], [(138.676186, 184.125385), (138.676186, 182.615961), (138.676186, 181.106537), (138.676186, 179.597113), (138.676186, 178.087689), (138.676186, 176.578265), (138.676186, 175.068841), (138.676186, 173.559417), (138.676186, 172.049993), (138.676186, 170.540569), (138.676186, 169.031145), (138.676186, 167.52172), (138.676186, 166.012296), (138.676186, 164.502872), (138.676186, 162.993448), (138.676186, 161.484024), (138.676186, 159.9746), (138.676186, 158.465176), (138.676186, 156.955752), (138.676186, 155.446328), (138.676186, 153.936904), (138.676186, 152.42748), (138.676186, 150.918055), (138.676186, 149.408631), (138.676186, 147.899207), (138.676186, 146.389783), (138.676186, 144.880359), (138.676186, 143.370935), (138.676186, 141.861511), (138.676186, 140.352087), (138.676186, 138.842663), (138.676186, 137.333239), (138.676186, 135.823815)], [(138.676186, 184.125385), (186.474615, 184.125385)], [(138.676186, 135.823815), (186.474615, 135.823815)]])\nVISIBLE_CIRCLES = [(100.5254, 159.9746, 24.150785)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (100.5254, 159.9746), 24.1508, 45), ('horizontal', '98.9583', (186.4746, 159.9746), (138.6762, 159.9746), (162.5754, 148.9746))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0010_00107752_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0012_00123959","images":["images/0012_00123959.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 413.043 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.767122, 144.001522), (84.352477, 144.001522), (84.937832, 144.001522), (85.523187, 144.001522), (86.108542, 144.001522), (86.693896, 144.001522), (87.279251, 144.001522), (87.864606, 144.001522), (88.449961, 144.001522), (89.035316, 144.001522), (89.620671, 144.001522), (90.206026, 144.001522), (90.791381, 144.001522), (91.376735, 144.001522), (91.96209, 144.001522), (92.547445, 144.001522), (93.1328, 144.001522), (93.718155, 144.001522), (94.30351, 144.001522), (94.888865, 144.001522), (95.474219, 144.001522), (96.059574, 144.001522), (96.644929, 144.001522), (97.230284, 144.001522), (97.815639, 144.001522), (98.400994, 144.001522), (98.986349, 144.001522), (99.571704, 144.001522), (100.157058, 144.001522), (100.742413, 144.001522), (101.327768, 144.001522), (101.913123, 144.001522), (102.498478, 144.001522), (102.498478, 66.632878)], [(83.767122, 66.632878), (84.352477, 66.632878), (84.937832, 66.632878), (85.523187, 66.632878), (86.108542, 66.632878), (86.693896, 66.632878), (87.279251, 66.632878), (87.864606, 66.632878), (88.449961, 66.632878), (89.035316, 66.632878), (89.620671, 66.632878), (90.206026, 66.632878), (90.791381, 66.632878), (91.376735, 66.632878), (91.96209, 66.632878), (92.547445, 66.632878), (93.1328, 66.632878), (93.718155, 66.632878), (94.30351, 66.632878), (94.888865, 66.632878), (95.474219, 66.632878), (96.059574, 66.632878), (96.644929, 66.632878), (97.230284, 66.632878), (97.815639, 66.632878), (98.400994, 66.632878), (98.986349, 66.632878), (99.571704, 66.632878), (100.157058, 66.632878), (100.742413, 66.632878), (101.327768, 66.632878), (101.913123, 66.632878), (102.498478, 66.632878)], [(83.767122, 144.001522), (83.767122, 66.632878)], [(193.867122, 176.732878), (193.867122, 176.147523), (193.867122, 175.562168), (193.867122, 174.976813), (193.867122, 174.391458), (193.867122, 173.806104), (193.867122, 173.220749), (193.867122, 172.635394), (193.867122, 172.050039), (193.867122, 171.464684), (193.867122, 170.879329), (193.867122, 170.293974), (193.867122, 169.708619), (193.867122, 169.123265), (193.867122, 168.53791), (193.867122, 167.952555), (193.867122, 167.3672), (193.867122, 166.781845), (193.867122, 166.19649), (193.867122, 165.611135), (193.867122, 165.025781), (193.867122, 164.440426), (193.867122, 163.855071), (193.867122, 163.269716), (193.867122, 162.684361), (193.867122, 162.099006), (193.867122, 161.513651), (193.867122, 160.928296), (193.867122, 160.342942), (193.867122, 159.757587), (193.867122, 159.172232), (193.867122, 158.586877), (193.867122, 158.001522)], [(116.498478, 176.732878), (116.498478, 176.147523), (116.498478, 175.562168), (116.498478, 174.976813), (116.498478, 174.391458), (116.498478, 173.806104), (116.498478, 173.220749), (116.498478, 172.635394), (116.498478, 172.050039), (116.498478, 171.464684), (116.498478, 170.879329), (116.498478, 170.293974), (116.498478, 169.708619), (116.498478, 169.123265), (116.498478, 168.53791), (116.498478, 167.952555), (116.498478, 167.3672), (116.498478, 166.781845), (116.498478, 166.19649), (116.498478, 165.611135), (116.498478, 165.025781), (116.498478, 164.440426), (116.498478, 163.855071), (116.498478, 163.269716), (116.498478, 162.684361), (116.498478, 162.099006), (116.498478, 161.513651), (116.498478, 160.928296), (116.498478, 160.342942), (116.498478, 159.757587), (116.498478, 159.172232), (116.498478, 158.586877), (116.498478, 158.001522)], [(193.867122, 158.001522), (116.498478, 158.001522)], [(193.867122, 176.732878), (116.498478, 176.732878)]])\nVISIBLE_CIRCLES = [(93.1328, 167.3672, 9.365678)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45), ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0012_00123959_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0014_00141432","images":["images/0014_00141432.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 57.7257 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6092856356631827\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(134.146382, 77.182182), (134.146382, 112.353618)], [(73.217818, 112.353618), (75.121836, 112.353618), (77.025853, 112.353618), (78.929871, 112.353618), (80.833889, 112.353618), (82.737906, 112.353618), (84.641924, 112.353618), (86.545941, 112.353618), (88.449959, 112.353618), (90.353977, 112.353618), (92.257994, 112.353618), (94.162012, 112.353618), (96.06603, 112.353618), (97.970047, 112.353618), (99.874065, 112.353618), (101.778082, 112.353618), (103.6821, 112.353618), (105.586118, 112.353618), (107.490135, 112.353618), (109.394153, 112.353618), (111.29817, 112.353618), (113.202188, 112.353618), (115.106206, 112.353618), (117.010223, 112.353618), (118.914241, 112.353618), (120.818259, 112.353618), (122.722276, 112.353618), (124.626294, 112.353618), (126.530311, 112.353618), (128.434329, 112.353618), (130.338347, 112.353618), (132.242364, 112.353618), (134.146382, 112.353618)], [(73.217818, 77.182182), (75.121836, 77.182182), (77.025853, 77.182182), (78.929871, 77.182182), (80.833889, 77.182182), (82.737906, 77.182182), (84.641924, 77.182182), (86.545941, 77.182182), (88.449959, 77.182182), (90.353977, 77.182182), (92.257994, 77.182182), (94.162012, 77.182182), (96.06603, 77.182182), (97.970047, 77.182182), (99.874065, 77.182182), (101.778082, 77.182182), (103.6821, 77.182182), (105.586118, 77.182182), (107.490135, 77.182182), (109.394153, 77.182182), (111.29817, 77.182182), (113.202188, 77.182182), (115.106206, 77.182182), (117.010223, 77.182182), (118.914241, 77.182182), (120.818259, 77.182182), (122.722276, 77.182182), (124.626294, 77.182182), (126.530311, 77.182182), (128.434329, 77.182182), (130.338347, 77.182182), (132.242364, 77.182182), (134.146382, 77.182182)], [(73.217818, 112.353618), (73.217818, 77.182182)], [(183.317818, 187.282182), (183.317818, 185.378164), (183.317818, 183.474147), (183.317818, 181.570129), (183.317818, 179.666111), (183.317818, 177.762094), (183.317818, 175.858076), (183.317818, 173.954059), (183.317818, 172.050041), (183.317818, 170.146023), (183.317818, 168.242006), (183.317818, 166.337988), (183.317818, 164.43397), (183.317818, 162.529953), (183.317818, 160.625935), (183.317818, 158.721918), (183.317818, 156.8179), (183.317818, 154.913882), (183.317818, 153.009865), (183.317818, 151.105847), (183.317818, 149.20183), (183.317818, 147.297812), (183.317818, 145.393794), (183.317818, 143.489777), (183.317818, 141.585759), (183.317818, 139.681741), (183.317818, 137.777724), (183.317818, 135.873706), (183.317818, 133.969689), (183.317818, 132.065671), (183.317818, 130.161653), (183.317818, 128.257636), (183.317818, 126.353618)], [(148.146382, 187.282182), (148.146382, 185.378164), (148.146382, 183.474147), (148.146382, 181.570129), (148.146382, 179.666111), (148.146382, 177.762094), (148.146382, 175.858076), (148.146382, 173.954059), (148.146382, 172.050041), (148.146382, 170.146023), (148.146382, 168.242006), (148.146382, 166.337988), (148.146382, 164.43397), (148.146382, 162.529953), (148.146382, 160.625935), (148.146382, 158.721918), (148.146382, 156.8179), (148.146382, 154.913882), (148.146382, 153.009865), (148.146382, 151.105847), (148.146382, 149.20183), (148.146382, 147.297812), (148.146382, 145.393794), (148.146382, 143.489777), (148.146382, 141.585759), (148.146382, 139.681741), (148.146382, 137.777724), (148.146382, 135.873706), (148.146382, 133.969689), (148.146382, 132.065671), (148.146382, 130.161653), (148.146382, 128.257636), (148.146382, 126.353618)], [(183.317818, 126.353618), (148.146382, 126.353618)], [(183.317818, 187.282182), (148.146382, 187.282182)]])\nVISIBLE_CIRCLES = [(103.6821, 156.8179, 30.464282)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (103.6821, 156.8179), 30.4643, 45), ('horizontal', '57.7257', (148.1464, 156.8179), (183.3179, 156.8179), (165.7321, 167.8179))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0014_00141432_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0030_00304727","images":["images/0030_00304727.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 32.62 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7246069394096344\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(142.795547, 80.065247), (140.53115, 80.065247), (138.266754, 80.065247), (136.002357, 80.065247), (133.73796, 80.065247), (131.473564, 80.065247), (129.209167, 80.065247), (126.94477, 80.065247), (124.680373, 80.065247), (122.415977, 80.065247), (120.15158, 80.065247), (117.887183, 80.065247), (115.622787, 80.065247), (113.35839, 80.065247), (111.093993, 80.065247), (108.829597, 80.065247), (106.5652, 80.065247), (104.300803, 80.065247), (102.036407, 80.065247), (99.77201, 80.065247), (97.507613, 80.065247), (95.243217, 80.065247), (92.97882, 80.065247), (90.714423, 80.065247), (88.450027, 80.065247), (86.18563, 80.065247), (83.921233, 80.065247), (81.656836, 80.065247), (79.39244, 80.065247), (77.128043, 80.065247), (74.863646, 80.065247), (72.59925, 80.065247), (70.334853, 80.065247)], [(142.795547, 80.065247), (142.795547, 103.704553), (140.53115, 103.704553), (138.266754, 103.704553), (136.002357, 103.704553), (133.73796, 103.704553), (131.473564, 103.704553), (129.209167, 103.704553), (126.94477, 103.704553), (124.680373, 103.704553), (122.415977, 103.704553), (120.15158, 103.704553), (117.887183, 103.704553), (115.622787, 103.704553), (113.35839, 103.704553), (111.093993, 103.704553), (108.829597, 103.704553), (106.5652, 103.704553), (104.300803, 103.704553), (102.036407, 103.704553), (99.77201, 103.704553), (97.507613, 103.704553), (95.243217, 103.704553), (92.97882, 103.704553), (90.714423, 103.704553), (88.450027, 103.704553), (86.18563, 103.704553), (83.921233, 103.704553), (81.656836, 103.704553), (79.39244, 103.704553), (77.128043, 103.704553), (74.863646, 103.704553), (72.59925, 103.704553), (70.334853, 103.704553), (70.334853, 80.065247)], [(156.795547, 117.704553), (156.795547, 119.96895), (156.795547, 122.233346), (156.795547, 124.497743), (156.795547, 126.76214), (156.795547, 129.026536), (156.795547, 131.290933), (156.795547, 133.55533), (156.795547, 135.819727), (156.795547, 138.084123), (156.795547, 140.34852), (156.795547, 142.612917), (156.795547, 144.877313), (156.795547, 147.14171), (156.795547, 149.406107), (156.795547, 151.670503), (156.795547, 153.9349), (156.795547, 156.199297), (156.795547, 158.463693), (156.795547, 160.72809), (156.795547, 162.992487), (156.795547, 165.256883), (156.795547, 167.52128), (156.795547, 169.785677), (156.795547, 172.050073), (156.795547, 174.31447), (156.795547, 176.578867), (156.795547, 178.843264), (156.795547, 181.10766), (156.795547, 183.372057), (156.795547, 185.636454), (156.795547, 187.90085), (156.795547, 190.165247)], [(180.434853, 117.704553), (180.434853, 119.96895), (180.434853, 122.233346), (180.434853, 124.497743), (180.434853, 126.76214), (180.434853, 129.026536), (180.434853, 131.290933), (180.434853, 133.55533), (180.434853, 135.819727), (180.434853, 138.084123), (180.434853, 140.34852), (180.434853, 142.612917), (180.434853, 144.877313), (180.434853, 147.14171), (180.434853, 149.406107), (180.434853, 151.670503), (180.434853, 153.9349), (180.434853, 156.199297), (180.434853, 158.463693), (180.434853, 160.72809), (180.434853, 162.992487), (180.434853, 165.256883), (180.434853, 167.52128), (180.434853, 169.785677), (180.434853, 172.050073), (180.434853, 174.31447), (180.434853, 176.578867), (180.434853, 178.843264), (180.434853, 181.10766), (180.434853, 183.372057), (180.434853, 185.636454), (180.434853, 187.90085), (180.434853, 190.165247)], [(180.434853, 117.704553), (156.795547, 117.704553)], [(180.434853, 190.165247), (156.795547, 190.165247)]])\nVISIBLE_CIRCLES = [(106.5652, 153.9349, 36.230347)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (106.5652, 153.9349), 36.2303, 45), ('horizontal', '32.6236', (156.7955, 153.9349), (180.4348, 153.9349), (168.6152, 164.9349))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0030_00304727_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00330691","images":["images/0033_00330691.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 950 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.09152380952380952\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(86.16191, 151.185709), (86.447921, 151.185709), (86.733933, 151.185709), (87.019945, 151.185709), (87.305957, 151.185709), (87.591969, 151.185709), (87.877981, 151.185709), (88.163993, 151.185709), (88.450005, 151.185709), (88.736017, 151.185709), (89.022029, 151.185709), (89.30804, 151.185709), (89.594052, 151.185709), (89.880064, 151.185709), (90.166076, 151.185709), (90.452088, 151.185709), (90.7381, 151.185709), (91.024112, 151.185709), (91.310124, 151.185709), (91.596136, 151.185709), (91.882148, 151.185709), (92.16816, 151.185709), (92.454171, 151.185709), (92.740183, 151.185709), (93.026195, 151.185709), (93.312207, 151.185709), (93.598219, 151.185709), (93.884231, 151.185709), (94.170243, 151.185709), (94.456255, 151.185709), (94.742267, 151.185709), (95.028279, 151.185709), (95.31429, 151.185709), (95.31429, 64.23809)], [(86.16191, 64.23809), (86.447921, 64.23809), (86.733933, 64.23809), (87.019945, 64.23809), (87.305957, 64.23809), (87.591969, 64.23809), (87.877981, 64.23809), (88.163993, 64.23809), (88.450005, 64.23809), (88.736017, 64.23809), (89.022029, 64.23809), (89.30804, 64.23809), (89.594052, 64.23809), (89.880064, 64.23809), (90.166076, 64.23809), (90.452088, 64.23809), (90.7381, 64.23809), (91.024112, 64.23809), (91.310124, 64.23809), (91.596136, 64.23809), (91.882148, 64.23809), (92.16816, 64.23809), (92.454171, 64.23809), (92.740183, 64.23809), (93.026195, 64.23809), (93.312207, 64.23809), (93.598219, 64.23809), (93.884231, 64.23809), (94.170243, 64.23809), (94.456255, 64.23809), (94.742267, 64.23809), (95.028279, 64.23809), (95.31429, 64.23809)], [(86.16191, 64.23809), (86.16191, 151.185709)], [(196.26191, 174.33809), (196.26191, 174.052079), (196.26191, 173.766067), (196.26191, 173.480055), (196.26191, 173.194043), (196.26191, 172.908031), (196.26191, 172.622019), (196.26191, 172.336007), (196.26191, 172.049995), (196.26191, 171.763983), (196.26191, 171.477971), (196.26191, 171.19196), (196.26191, 170.905948), (196.26191, 170.619936), (196.26191, 170.333924), (196.26191, 170.047912), (196.26191, 169.7619), (196.26191, 169.475888), (196.26191, 169.189876), (196.26191, 168.903864), (196.26191, 168.617852), (196.26191, 168.33184), (196.26191, 168.045829), (196.26191, 167.759817), (196.26191, 167.473805), (196.26191, 167.187793), (196.26191, 166.901781), (196.26191, 166.615769), (196.26191, 166.329757), (196.26191, 166.043745), (196.26191, 165.757733), (196.26191, 165.471721), (196.26191, 165.18571)], [(109.314291, 174.33809), (109.314291, 174.052079), (109.314291, 173.766067), (109.314291, 173.480055), (109.314291, 173.194043), (109.314291, 172.908031), (109.314291, 172.622019), (109.314291, 172.336007), (109.314291, 172.049995), (109.314291, 171.763983), (109.314291, 171.477971), (109.314291, 171.19196), (109.314291, 170.905948), (109.314291, 170.619936), (109.314291, 170.333924), (109.314291, 170.047912), (109.314291, 169.7619), (109.314291, 169.475888), (109.314291, 169.189876), (109.314291, 168.903864), (109.314291, 168.617852), (109.314291, 168.33184), (109.314291, 168.045829), (109.314291, 167.759817), (109.314291, 167.473805), (109.314291, 167.187793), (109.314291, 166.901781), (109.314291, 166.615769), (109.314291, 166.329757), (109.314291, 166.043745), (109.314291, 165.757733), (109.314291, 165.471721), (109.314291, 165.18571)], [(109.314291, 174.33809), (196.26191, 174.33809)], [(109.314291, 165.18571), (196.26191, 165.18571)]])\nVISIBLE_CIRCLES = [(90.7381, 169.7619, 4.57619)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (90.7381, 169.7619), 4.5762, 45), ('horizontal', '950', (196.2619, 169.7619), (109.3143, 169.7619), (152.7881, 158.7619))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00330691_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00337037","images":["images/0033_00337037.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 351.85 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.21268032786887686\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.132984, 142.098983), (83.79761, 142.098983), (84.462236, 142.098983), (85.126862, 142.098983), (85.791488, 142.098983), (86.456114, 142.098983), (87.12074, 142.098983), (87.785366, 142.098983), (88.449992, 142.098983), (89.114618, 142.098983), (89.779244, 142.098983), (90.44387, 142.098983), (91.108496, 142.098983), (91.773122, 142.098983), (92.437748, 142.098983), (93.102374, 142.098983), (93.767, 142.098983), (94.431626, 142.098983), (95.096252, 142.098983), (95.760878, 142.098983), (96.425504, 142.098983), (97.09013, 142.098983), (97.754756, 142.098983), (98.419382, 142.098983), (99.084008, 142.098983), (99.748634, 142.098983), (100.41326, 142.098983), (101.077886, 142.098983), (101.742512, 142.098983), (102.407138, 142.098983), (103.071764, 142.098983), (103.73639, 142.098983), (104.401016, 142.098983), (104.401016, 67.267016)], [(83.132984, 67.267016), (83.79761, 67.267016), (84.462236, 67.267016), (85.126862, 67.267016), (85.791488, 67.267016), (86.456114, 67.267016), (87.12074, 67.267016), (87.785366, 67.267016), (88.449992, 67.267016), (89.114618, 67.267016), (89.779244, 67.267016), (90.44387, 67.267016), (91.108496, 67.267016), (91.773122, 67.267016), (92.437748, 67.267016), (93.102374, 67.267016), (93.767, 67.267016), (94.431626, 67.267016), (95.096252, 67.267016), (95.760878, 67.267016), (96.425504, 67.267016), (97.09013, 67.267016), (97.754756, 67.267016), (98.419382, 67.267016), (99.084008, 67.267016), (99.748634, 67.267016), (100.41326, 67.267016), (101.077886, 67.267016), (101.742512, 67.267016), (102.407138, 67.267016), (103.071764, 67.267016), (103.73639, 67.267016), (104.401016, 67.267016)], [(83.132984, 67.267016), (83.132984, 142.098983)], [(193.232984, 177.367016), (193.232984, 176.70239), (193.232984, 176.037764), (193.232984, 175.373138), (193.232984, 174.708512), (193.232984, 174.043886), (193.232984, 173.37926), (193.232984, 172.714634), (193.232984, 172.050008), (193.232984, 171.385382), (193.232984, 170.720756), (193.232984, 170.05613), (193.232984, 169.391504), (193.232984, 168.726878), (193.232984, 168.062252), (193.232984, 167.397626), (193.232984, 166.733), (193.232984, 166.068374), (193.232984, 165.403748), (193.232984, 164.739122), (193.232984, 164.074496), (193.232984, 163.40987), (193.232984, 162.745244), (193.232984, 162.080618), (193.232984, 161.415992), (193.232984, 160.751366), (193.232984, 160.08674), (193.232984, 159.422114), (193.232984, 158.757488), (193.232984, 158.092862), (193.232984, 157.428236), (193.232984, 156.76361), (193.232984, 156.098984)], [(118.401017, 177.367016), (118.401017, 176.70239), (118.401017, 176.037764), (118.401017, 175.373138), (118.401017, 174.708512), (118.401017, 174.043886), (118.401017, 173.37926), (118.401017, 172.714634), (118.401017, 172.050008), (118.401017, 171.385382), (118.401017, 170.720756), (118.401017, 170.05613), (118.401017, 169.391504), (118.401017, 168.726878), (118.401017, 168.062252), (118.401017, 167.397626), (118.401017, 166.733), (118.401017, 166.068374), (118.401017, 165.403748), (118.401017, 164.739122), (118.401017, 164.074496), (118.401017, 163.40987), (118.401017, 162.745244), (118.401017, 162.080618), (118.401017, 161.415992), (118.401017, 160.751366), (118.401017, 160.08674), (118.401017, 159.422114), (118.401017, 158.757488), (118.401017, 158.092862), (118.401017, 157.428236), (118.401017, 156.76361), (118.401017, 156.098984)], [(118.401017, 177.367016), (193.232984, 177.367016)], [(118.401017, 156.098984), (193.232984, 156.098984)]])\nVISIBLE_CIRCLES = [(93.767, 166.733, 10.634016)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.767, 166.733), 10.634, 45), ('horizontal', '351.852', (193.233, 166.733), (118.401, 166.733), (155.817, 155.733))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00337037_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00337038","images":["images/0033_00337038.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 206.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3135177304964895\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(80.612013, 134.536213), (81.591756, 134.536213), (82.571499, 134.536213), (83.551242, 134.536213), (84.530985, 134.536213), (85.510728, 134.536213), (86.490471, 134.536213), (87.470214, 134.536213), (88.449957, 134.536213), (89.4297, 134.536213), (90.409443, 134.536213), (91.389185, 134.536213), (92.368928, 134.536213), (93.348671, 134.536213), (94.328414, 134.536213), (95.308157, 134.536213), (96.2879, 134.536213), (97.267643, 134.536213), (98.247386, 134.536213), (99.227129, 134.536213), (100.206872, 134.536213), (101.186615, 134.536213), (102.166357, 134.536213), (103.1461, 134.536213), (104.125843, 134.536213), (105.105586, 134.536213), (106.085329, 134.536213), (107.065072, 134.536213), (108.044815, 134.536213), (109.024558, 134.536213), (110.004301, 134.536213), (110.984044, 134.536213), (111.963787, 134.536213), (111.963787, 69.787986)], [(80.612013, 69.787986), (81.591756, 69.787986), (82.571499, 69.787986), (83.551242, 69.787986), (84.530985, 69.787986), (85.510728, 69.787986), (86.490471, 69.787986), (87.470214, 69.787986), (88.449957, 69.787986), (89.4297, 69.787986), (90.409443, 69.787986), (91.389185, 69.787986), (92.368928, 69.787986), (93.348671, 69.787986), (94.328414, 69.787986), (95.308157, 69.787986), (96.2879, 69.787986), (97.267643, 69.787986), (98.247386, 69.787986), (99.227129, 69.787986), (100.206872, 69.787986), (101.186615, 69.787986), (102.166357, 69.787986), (103.1461, 69.787986), (104.125843, 69.787986), (105.105586, 69.787986), (106.085329, 69.787986), (107.065072, 69.787986), (108.044815, 69.787986), (109.024558, 69.787986), (110.004301, 69.787986), (110.984044, 69.787986), (111.963787, 69.787986)], [(80.612013, 69.787986), (80.612013, 134.536213)], [(190.712014, 179.887987), (190.712014, 178.908244), (190.712014, 177.928501), (190.712014, 176.948758), (190.712014, 175.969015), (190.712014, 174.989272), (190.712014, 174.009529), (190.712014, 173.029786), (190.712014, 172.050043), (190.712014, 171.0703), (190.712014, 170.090557), (190.712014, 169.110815), (190.712014, 168.131072), (190.712014, 167.151329), (190.712014, 166.171586), (190.712014, 165.191843), (190.712014, 164.2121), (190.712014, 163.232357), (190.712014, 162.252614), (190.712014, 161.272871), (190.712014, 160.293128), (190.712014, 159.313385), (190.712014, 158.333643), (190.712014, 157.3539), (190.712014, 156.374157), (190.712014, 155.394414), (190.712014, 154.414671), (190.712014, 153.434928), (190.712014, 152.455185), (190.712014, 151.475442), (190.712014, 150.495699), (190.712014, 149.515956), (190.712014, 148.536213)], [(125.963787, 179.887987), (125.963787, 178.908244), (125.963787, 177.928501), (125.963787, 176.948758), (125.963787, 175.969015), (125.963787, 174.989272), (125.963787, 174.009529), (125.963787, 173.029786), (125.963787, 172.050043), (125.963787, 171.0703), (125.963787, 170.090557), (125.963787, 169.110815), (125.963787, 168.131072), (125.963787, 167.151329), (125.963787, 166.171586), (125.963787, 165.191843), (125.963787, 164.2121), (125.963787, 163.232357), (125.963787, 162.252614), (125.963787, 161.272871), (125.963787, 160.293128), (125.963787, 159.313385), (125.963787, 158.333643), (125.963787, 157.3539), (125.963787, 156.374157), (125.963787, 155.394414), (125.963787, 154.414671), (125.963787, 153.434928), (125.963787, 152.455185), (125.963787, 151.475442), (125.963787, 150.495699), (125.963787, 149.515956), (125.963787, 148.536213)], [(125.963787, 179.887987), (190.712014, 179.887987)], [(125.963787, 148.536213), (190.712014, 148.536213)]])\nVISIBLE_CIRCLES = [(96.2879, 164.2121, 15.675887)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (96.2879, 164.2121), 15.6759, 45), ('horizontal', '206.522', (190.7121, 164.2121), (125.9638, 164.2121), (158.3379, 153.2121))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00337038_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0034_00347353","images":["images/0034_00347353.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 8.76 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.883581184217089\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(154.718559, 84.039559), (151.957368, 84.039559), (149.196177, 84.039559), (146.434986, 84.039559), (143.673794, 84.039559), (140.912603, 84.039559), (138.151412, 84.039559), (135.390221, 84.039559), (132.62903, 84.039559), (129.867838, 84.039559), (127.106647, 84.039559), (124.345456, 84.039559), (121.584265, 84.039559), (118.823074, 84.039559), (116.061882, 84.039559), (113.300691, 84.039559), (110.5395, 84.039559), (107.778309, 84.039559), (105.017118, 84.039559), (102.255926, 84.039559), (99.494735, 84.039559), (96.733544, 84.039559), (93.972353, 84.039559), (91.211162, 84.039559), (88.44997, 84.039559), (85.688779, 84.039559), (82.927588, 84.039559), (80.166397, 84.039559), (77.405206, 84.039559), (74.644014, 84.039559), (71.882823, 84.039559), (69.121632, 84.039559), (66.360441, 84.039559)], [(154.718559, 84.039559), (154.718559, 91.781441), (151.957368, 91.781441), (149.196177, 91.781441), (146.434986, 91.781441), (143.673794, 91.781441), (140.912603, 91.781441), (138.151412, 91.781441), (135.390221, 91.781441), (132.62903, 91.781441), (129.867838, 91.781441), (127.106647, 91.781441), (124.345456, 91.781441), (121.584265, 91.781441), (118.823074, 91.781441), (116.061882, 91.781441), (113.300691, 91.781441), (110.5395, 91.781441), (107.778309, 91.781441), (105.017118, 91.781441), (102.255926, 91.781441), (99.494735, 91.781441), (96.733544, 91.781441), (93.972353, 91.781441), (91.211162, 91.781441), (88.44997, 91.781441), (85.688779, 91.781441), (82.927588, 91.781441), (80.166397, 91.781441), (77.405206, 91.781441), (74.644014, 91.781441), (71.882823, 91.781441), (69.121632, 91.781441), (66.360441, 91.781441), (66.360441, 84.039559)], [(168.718559, 105.781441), (168.718559, 108.542632), (168.718559, 111.303823), (168.718559, 114.065014), (168.718559, 116.826206), (168.718559, 119.587397), (168.718559, 122.348588), (168.718559, 125.109779), (168.718559, 127.87097), (168.718559, 130.632162), (168.718559, 133.393353), (168.718559, 136.154544), (168.718559, 138.915735), (168.718559, 141.676926), (168.718559, 144.438118), (168.718559, 147.199309), (168.718559, 149.9605), (168.718559, 152.721691), (168.718559, 155.482882), (168.718559, 158.244074), (168.718559, 161.005265), (168.718559, 163.766456), (168.718559, 166.527647), (168.718559, 169.288838), (168.718559, 172.05003), (168.718559, 174.811221), (168.718559, 177.572412), (168.718559, 180.333603), (168.718559, 183.094794), (168.718559, 185.855986), (168.718559, 188.617177), (168.718559, 191.378368), (168.718559, 194.139559)], [(176.460441, 105.781441), (176.460441, 108.542632), (176.460441, 111.303823), (176.460441, 114.065014), (176.460441, 116.826206), (176.460441, 119.587397), (176.460441, 122.348588), (176.460441, 125.109779), (176.460441, 127.87097), (176.460441, 130.632162), (176.460441, 133.393353), (176.460441, 136.154544), (176.460441, 138.915735), (176.460441, 141.676926), (176.460441, 144.438118), (176.460441, 147.199309), (176.460441, 149.9605), (176.460441, 152.721691), (176.460441, 155.482882), (176.460441, 158.244074), (176.460441, 161.005265), (176.460441, 163.766456), (176.460441, 166.527647), (176.460441, 169.288838), (176.460441, 172.05003), (176.460441, 174.811221), (176.460441, 177.572412), (176.460441, 180.333603), (176.460441, 183.094794), (176.460441, 185.855986), (176.460441, 188.617177), (176.460441, 191.378368), (176.460441, 194.139559)], [(176.460441, 105.781441), (168.718559, 105.781441)], [(176.460441, 194.139559), (168.718559, 194.139559)]])\nVISIBLE_CIRCLES = [(110.5395, 149.9605, 44.179059)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (110.5395, 149.9605), 44.1791, 45), ('horizontal', '8.7619', (168.7186, 149.9605), (176.4604, 149.9605), (172.5895, 160.9605))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0034_00347353_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0035_00357735","images":["images/0035_00357735.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 404.26 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1905780590717436\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.685497, 143.756597), (84.281053, 143.756597), (84.87661, 143.756597), (85.472166, 143.756597), (86.067723, 143.756597), (86.663279, 143.756597), (87.258836, 143.756597), (87.854392, 143.756597), (88.449949, 143.756597), (89.045505, 143.756597), (89.641061, 143.756597), (90.236618, 143.756597), (90.832174, 143.756597), (91.427731, 143.756597), (92.023287, 143.756597), (92.618844, 143.756597), (93.2144, 143.756597), (93.809956, 143.756597), (94.405513, 143.756597), (95.001069, 143.756597), (95.596626, 143.756597), (96.192182, 143.756597), (96.787739, 143.756597), (97.383295, 143.756597), (97.978851, 143.756597), (98.574408, 143.756597), (99.169964, 143.756597), (99.765521, 143.756597), (100.361077, 143.756597), (100.956634, 143.756597), (101.55219, 143.756597), (102.147747, 143.756597), (102.743303, 143.756597), (102.743303, 66.714403)], [(83.685497, 66.714403), (84.281053, 66.714403), (84.87661, 66.714403), (85.472166, 66.714403), (86.067723, 66.714403), (86.663279, 66.714403), (87.258836, 66.714403), (87.854392, 66.714403), (88.449949, 66.714403), (89.045505, 66.714403), (89.641061, 66.714403), (90.236618, 66.714403), (90.832174, 66.714403), (91.427731, 66.714403), (92.023287, 66.714403), (92.618844, 66.714403), (93.2144, 66.714403), (93.809956, 66.714403), (94.405513, 66.714403), (95.001069, 66.714403), (95.596626, 66.714403), (96.192182, 66.714403), (96.787739, 66.714403), (97.383295, 66.714403), (97.978851, 66.714403), (98.574408, 66.714403), (99.169964, 66.714403), (99.765521, 66.714403), (100.361077, 66.714403), (100.956634, 66.714403), (101.55219, 66.714403), (102.147747, 66.714403), (102.743303, 66.714403)], [(83.685497, 66.714403), (83.685497, 143.756597)], [(193.785497, 176.814403), (193.785497, 176.218847), (193.785497, 175.62329), (193.785497, 175.027734), (193.785497, 174.432177), (193.785497, 173.836621), (193.785497, 173.241064), (193.785497, 172.645508), (193.785497, 172.049951), (193.785497, 171.454395), (193.785497, 170.858839), (193.785497, 170.263282), (193.785497, 169.667726), (193.785497, 169.072169), (193.785497, 168.476613), (193.785497, 167.881056), (193.785497, 167.2855), (193.785497, 166.689944), (193.785497, 166.094387), (193.785497, 165.498831), (193.785497, 164.903274), (193.785497, 164.307718), (193.785497, 163.712161), (193.785497, 163.116605), (193.785497, 162.521049), (193.785497, 161.925492), (193.785497, 161.329936), (193.785497, 160.734379), (193.785497, 160.138823), (193.785497, 159.543266), (193.785497, 158.94771), (193.785497, 158.352153), (193.785497, 157.756597)], [(116.743303, 176.814403), (116.743303, 176.218847), (116.743303, 175.62329), (116.743303, 175.027734), (116.743303, 174.432177), (116.743303, 173.836621), (116.743303, 173.241064), (116.743303, 172.645508), (116.743303, 172.049951), (116.743303, 171.454395), (116.743303, 170.858839), (116.743303, 170.263282), (116.743303, 169.667726), (116.743303, 169.072169), (116.743303, 168.476613), (116.743303, 167.881056), (116.743303, 167.2855), (116.743303, 166.689944), (116.743303, 166.094387), (116.743303, 165.498831), (116.743303, 164.903274), (116.743303, 164.307718), (116.743303, 163.712161), (116.743303, 163.116605), (116.743303, 162.521049), (116.743303, 161.925492), (116.743303, 161.329936), (116.743303, 160.734379), (116.743303, 160.138823), (116.743303, 159.543266), (116.743303, 158.94771), (116.743303, 158.352153), (116.743303, 157.756597)], [(116.743303, 176.814403), (193.785497, 176.814403)], [(116.743303, 157.756597), (193.785497, 157.756597)]])\nVISIBLE_CIRCLES = [(93.2144, 167.2855, 9.528903)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.2144, 167.2855), 9.5289, 45), ('horizontal', '404.255', (193.7855, 167.2855), (116.7434, 167.2855), (155.2645, 156.2855))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0035_00357735_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0042_00424809","images":["images/0042_00424809.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 49.48 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6428989547038615\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(72.377552, 109.832552), (74.386611, 109.832552), (76.395671, 109.832552), (78.40473, 109.832552), (80.413789, 109.832552), (82.422848, 109.832552), (84.431908, 109.832552), (86.440967, 109.832552), (88.450026, 109.832552), (90.459085, 109.832552), (92.468145, 109.832552), (94.477204, 109.832552), (96.486263, 109.832552), (98.495322, 109.832552), (100.504382, 109.832552), (102.513441, 109.832552), (104.5225, 109.832552), (106.531559, 109.832552), (108.540618, 109.832552), (110.549678, 109.832552), (112.558737, 109.832552), (114.567796, 109.832552), (116.576855, 109.832552), (118.585915, 109.832552), (120.594974, 109.832552), (122.604033, 109.832552), (124.613092, 109.832552), (126.622152, 109.832552), (128.631211, 109.832552), (130.64027, 109.832552), (132.649329, 109.832552), (134.658389, 109.832552), (136.667448, 109.832552), (136.667448, 78.022448)], [(72.377552, 78.022448), (74.386611, 78.022448), (76.395671, 78.022448), (78.40473, 78.022448), (80.413789, 78.022448), (82.422848, 78.022448), (84.431908, 78.022448), (86.440967, 78.022448), (88.450026, 78.022448), (90.459085, 78.022448), (92.468145, 78.022448), (94.477204, 78.022448), (96.486263, 78.022448), (98.495322, 78.022448), (100.504382, 78.022448), (102.513441, 78.022448), (104.5225, 78.022448), (106.531559, 78.022448), (108.540618, 78.022448), (110.549678, 78.022448), (112.558737, 78.022448), (114.567796, 78.022448), (116.576855, 78.022448), (118.585915, 78.022448), (120.594974, 78.022448), (122.604033, 78.022448), (124.613092, 78.022448), (126.622152, 78.022448), (128.631211, 78.022448), (130.64027, 78.022448), (132.649329, 78.022448), (134.658389, 78.022448), (136.667448, 78.022448)], [(72.377552, 78.022448), (72.377552, 109.832552)], [(182.477552, 188.122448), (182.477552, 186.113389), (182.477552, 184.104329), (182.477552, 182.09527), (182.477552, 180.086211), (182.477552, 178.077152), (182.477552, 176.068092), (182.477552, 174.059033), (182.477552, 172.049974), (182.477552, 170.040915), (182.477552, 168.031855), (182.477552, 166.022796), (182.477552, 164.013737), (182.477552, 162.004678), (182.477552, 159.995618), (182.477552, 157.986559), (182.477552, 155.9775), (182.477552, 153.968441), (182.477552, 151.959382), (182.477552, 149.950322), (182.477552, 147.941263), (182.477552, 145.932204), (182.477552, 143.923145), (182.477552, 141.914085), (182.477552, 139.905026), (182.477552, 137.895967), (182.477552, 135.886908), (182.477552, 133.877848), (182.477552, 131.868789), (182.477552, 129.85973), (182.477552, 127.850671), (182.477552, 125.841611), (182.477552, 123.832552)], [(150.667448, 188.122448), (150.667448, 186.113389), (150.667448, 184.104329), (150.667448, 182.09527), (150.667448, 180.086211), (150.667448, 178.077152), (150.667448, 176.068092), (150.667448, 174.059033), (150.667448, 172.049974), (150.667448, 170.040915), (150.667448, 168.031855), (150.667448, 166.022796), (150.667448, 164.013737), (150.667448, 162.004678), (150.667448, 159.995618), (150.667448, 157.986559), (150.667448, 155.9775), (150.667448, 153.968441), (150.667448, 151.959382), (150.667448, 149.950322), (150.667448, 147.941263), (150.667448, 145.932204), (150.667448, 143.923145), (150.667448, 141.914085), (150.667448, 139.905026), (150.667448, 137.895967), (150.667448, 135.886908), (150.667448, 133.877848), (150.667448, 131.868789), (150.667448, 129.85973), (150.667448, 127.850671), (150.667448, 125.841611), (150.667448, 123.832552)], [(150.667448, 188.122448), (182.477552, 188.122448)], [(150.667448, 123.832552), (182.477552, 123.832552)]])\nVISIBLE_CIRCLES = [(104.5225, 155.9775, 32.144948)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (104.5225, 155.9775), 32.1449, 45), ('horizontal', '49.4792', (182.4775, 155.9775), (150.6674, 155.9775), (166.5725, 144.9775))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0042_00424809_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0046_00460346","images":["images/0046_00460346.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 395.83 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1938151260504332\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.604644, 143.513843), (84.210316, 143.513843), (84.815988, 143.513843), (85.421661, 143.513843), (86.027333, 143.513843), (86.633005, 143.513843), (87.238677, 143.513843), (87.84435, 143.513843), (88.450022, 143.513843), (89.055694, 143.513843), (89.661366, 143.513843), (90.267039, 143.513843), (90.872711, 143.513843), (91.478383, 143.513843), (92.084055, 143.513843), (92.689728, 143.513843), (93.2954, 143.513843), (93.901072, 143.513843), (94.506745, 143.513843), (95.112417, 143.513843), (95.718089, 143.513843), (96.323761, 143.513843), (96.929434, 143.513843), (97.535106, 143.513843), (98.140778, 143.513843), (98.74645, 143.513843), (99.352123, 143.513843), (99.957795, 143.513843), (100.563467, 143.513843), (101.169139, 143.513843), (101.774812, 143.513843), (102.380484, 143.513843), (102.986156, 143.513843), (102.986156, 66.795356)], [(83.604644, 66.795356), (84.210316, 66.795356), (84.815988, 66.795356), (85.421661, 66.795356), (86.027333, 66.795356), (86.633005, 66.795356), (87.238677, 66.795356), (87.84435, 66.795356), (88.450022, 66.795356), (89.055694, 66.795356), (89.661366, 66.795356), (90.267039, 66.795356), (90.872711, 66.795356), (91.478383, 66.795356), (92.084055, 66.795356), (92.689728, 66.795356), (93.2954, 66.795356), (93.901072, 66.795356), (94.506745, 66.795356), (95.112417, 66.795356), (95.718089, 66.795356), (96.323761, 66.795356), (96.929434, 66.795356), (97.535106, 66.795356), (98.140778, 66.795356), (98.74645, 66.795356), (99.352123, 66.795356), (99.957795, 66.795356), (100.563467, 66.795356), (101.169139, 66.795356), (101.774812, 66.795356), (102.380484, 66.795356), (102.986156, 66.795356)], [(83.604644, 66.795356), (83.604644, 143.513843)], [(193.704644, 176.895356), (193.704644, 176.289684), (193.704644, 175.684012), (193.704644, 175.078339), (193.704644, 174.472667), (193.704644, 173.866995), (193.704644, 173.261323), (193.704644, 172.65565), (193.704644, 172.049978), (193.704644, 171.444306), (193.704644, 170.838634), (193.704644, 170.232961), (193.704644, 169.627289), (193.704644, 169.021617), (193.704644, 168.415945), (193.704644, 167.810272), (193.704644, 167.2046), (193.704644, 166.598928), (193.704644, 165.993255), (193.704644, 165.387583), (193.704644, 164.781911), (193.704644, 164.176239), (193.704644, 163.570566), (193.704644, 162.964894), (193.704644, 162.359222), (193.704644, 161.75355), (193.704644, 161.147877), (193.704644, 160.542205), (193.704644, 159.936533), (193.704644, 159.330861), (193.704644, 158.725188), (193.704644, 158.119516), (193.704644, 157.513844)], [(116.986157, 176.895356), (116.986157, 176.289684), (116.986157, 175.684012), (116.986157, 175.078339), (116.986157, 174.472667), (116.986157, 173.866995), (116.986157, 173.261323), (116.986157, 172.65565), (116.986157, 172.049978), (116.986157, 171.444306), (116.986157, 170.838634), (116.986157, 170.232961), (116.986157, 169.627289), (116.986157, 169.021617), (116.986157, 168.415945), (116.986157, 167.810272), (116.986157, 167.2046), (116.986157, 166.598928), (116.986157, 165.993255), (116.986157, 165.387583), (116.986157, 164.781911), (116.986157, 164.176239), (116.986157, 163.570566), (116.986157, 162.964894), (116.986157, 162.359222), (116.986157, 161.75355), (116.986157, 161.147877), (116.986157, 160.542205), (116.986157, 159.936533), (116.986157, 159.330861), (116.986157, 158.725188), (116.986157, 158.119516), (116.986157, 157.513844)], [(116.986157, 176.895356), (193.704644, 176.895356)], [(116.986157, 157.513844), (193.704644, 157.513844)]])\nVISIBLE_CIRCLES = [(93.2954, 167.2046, 9.690756)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.2954, 167.2046), 9.6908, 45), ('horizontal', '395.833', (193.7046, 167.2046), (116.9861, 167.2046), (155.3454, 156.2046))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0046_00460346_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0049_00490810","images":["images/0049_00490810.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 1187.5 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.07464077669902913\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(94.048039, 63.816039), (93.814786, 63.816039), (93.581534, 63.816039), (93.348282, 63.816039), (93.115029, 63.816039), (92.881777, 63.816039), (92.648524, 63.816039), (92.415272, 63.816039), (92.182019, 63.816039), (91.948767, 63.816039), (91.715515, 63.816039), (91.482262, 63.816039), (91.24901, 63.816039), (91.015757, 63.816039), (90.782505, 63.816039), (90.549252, 63.816039), (90.316, 63.816039), (90.082748, 63.816039), (89.849495, 63.816039), (89.616243, 63.816039), (89.38299, 63.816039), (89.149738, 63.816039), (88.916485, 63.816039), (88.683233, 63.816039), (88.449981, 63.816039), (88.216728, 63.816039), (87.983476, 63.816039), (87.750223, 63.816039), (87.516971, 63.816039), (87.283718, 63.816039), (87.050466, 63.816039), (86.817214, 63.816039), (86.583961, 63.816039)], [(94.048039, 63.816039), (94.048039, 152.451961), (93.814786, 152.451961), (93.581534, 152.451961), (93.348282, 152.451961), (93.115029, 152.451961), (92.881777, 152.451961), (92.648524, 152.451961), (92.415272, 152.451961), (92.182019, 152.451961), (91.948767, 152.451961), (91.715515, 152.451961), (91.482262, 152.451961), (91.24901, 152.451961), (91.015757, 152.451961), (90.782505, 152.451961), (90.549252, 152.451961), (90.316, 152.451961), (90.082748, 152.451961), (89.849495, 152.451961), (89.616243, 152.451961), (89.38299, 152.451961), (89.149738, 152.451961), (88.916485, 152.451961), (88.683233, 152.451961), (88.449981, 152.451961), (88.216728, 152.451961), (87.983476, 152.451961), (87.750223, 152.451961), (87.516971, 152.451961), (87.283718, 152.451961), (87.050466, 152.451961), (86.817214, 152.451961), (86.583961, 152.451961), (86.583961, 63.816039)], [(108.048039, 166.451961), (108.048039, 166.685214), (108.048039, 166.918466), (108.048039, 167.151718), (108.048039, 167.384971), (108.048039, 167.618223), (108.048039, 167.851476), (108.048039, 168.084728), (108.048039, 168.317981), (108.048039, 168.551233), (108.048039, 168.784485), (108.048039, 169.017738), (108.048039, 169.25099), (108.048039, 169.484243), (108.048039, 169.717495), (108.048039, 169.950748), (108.048039, 170.184), (108.048039, 170.417252), (108.048039, 170.650505), (108.048039, 170.883757), (108.048039, 171.11701), (108.048039, 171.350262), (108.048039, 171.583515), (108.048039, 171.816767), (108.048039, 172.050019), (108.048039, 172.283272), (108.048039, 172.516524), (108.048039, 172.749777), (108.048039, 172.983029), (108.048039, 173.216282), (108.048039, 173.449534), (108.048039, 173.682786), (108.048039, 173.916039)], [(196.683961, 166.451961), (196.683961, 166.685214), (196.683961, 166.918466), (196.683961, 167.151718), (196.683961, 167.384971), (196.683961, 167.618223), (196.683961, 167.851476), (196.683961, 168.084728), (196.683961, 168.317981), (196.683961, 168.551233), (196.683961, 168.784485), (196.683961, 169.017738), (196.683961, 169.25099), (196.683961, 169.484243), (196.683961, 169.717495), (196.683961, 169.950748), (196.683961, 170.184), (196.683961, 170.417252), (196.683961, 170.650505), (196.683961, 170.883757), (196.683961, 171.11701), (196.683961, 171.350262), (196.683961, 171.583515), (196.683961, 171.816767), (196.683961, 172.050019), (196.683961, 172.283272), (196.683961, 172.516524), (196.683961, 172.749777), (196.683961, 172.983029), (196.683961, 173.216282), (196.683961, 173.449534), (196.683961, 173.682786), (196.683961, 173.916039)], [(196.683961, 166.451961), (108.048039, 166.451961)], [(196.683961, 173.916039), (108.048039, 173.916039)]])\nVISIBLE_CIRCLES = [(90.316, 170.184, 3.732039)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (90.316, 170.184), 3.732, 45), ('horizontal', '1187.5', (108.0481, 170.184), (196.684, 170.184), (152.366, 181.184))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0049_00490810_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0049_00494306","images":["images/0049_00494306.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 12.69 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(76.737, 96.2931), (79.032937, 96.2931), (81.328875, 96.2931), (83.624812, 96.2931), (85.92075, 96.2931), (88.216687, 96.2931), (90.512625, 96.2931), (92.808562, 96.2931), (95.1045, 96.2931), (97.400438, 96.2931), (99.696375, 96.2931), (101.992313, 96.2931), (104.28825, 96.2931), (106.584188, 96.2931), (108.880125, 96.2931), (111.176063, 96.2931), (113.472, 96.2931), (115.767937, 96.2931), (118.063875, 96.2931), (120.359812, 96.2931), (122.65575, 96.2931), (124.951687, 96.2931), (127.247625, 96.2931), (129.543562, 96.2931), (131.8395, 96.2931), (134.135437, 96.2931), (136.431375, 96.2931), (138.727312, 96.2931), (141.02325, 96.2931), (143.319187, 96.2931), (145.615125, 96.2931), (147.911062, 96.2931), (150.207, 96.2931), (150.207, 86.971986)], [(76.737, 86.971986), (79.032937, 86.971986), (81.328875, 86.971986), (83.624812, 86.971986), (85.92075, 86.971986), (88.216687, 86.971986), (90.512625, 86.971986), (92.808562, 86.971986), (95.1045, 86.971986), (97.400438, 86.971986), (99.696375, 86.971986), (101.992313, 86.971986), (104.28825, 86.971986), (106.584188, 86.971986), (108.880125, 86.971986), (111.176063, 86.971986), (113.472, 86.971986), (115.767937, 86.971986), (118.063875, 86.971986), (120.359812, 86.971986), (122.65575, 86.971986), (124.951687, 86.971986), (127.247625, 86.971986), (129.543562, 86.971986), (131.8395, 86.971986), (134.135437, 86.971986), (136.431375, 86.971986), (138.727312, 86.971986), (141.02325, 86.971986), (143.319187, 86.971986), (145.615125, 86.971986), (147.911062, 86.971986), (150.207, 86.971986)], [(76.737, 86.971986), (76.737, 96.2931)], [(173.528114, 183.7631), (173.528114, 181.467163), (173.528114, 179.171225), (173.528114, 176.875288), (173.528114, 174.57935), (173.528114, 172.283412), (173.528114, 169.987475), (173.528114, 167.691537), (173.528114, 165.3956), (173.528114, 163.099662), (173.528114, 160.803725), (173.528114, 158.507788), (173.528114, 156.21185), (173.528114, 153.915913), (173.528114, 151.619975), (173.528114, 149.324038), (173.528114, 147.0281), (173.528114, 144.732162), (173.528114, 142.436225), (173.528114, 140.140287), (173.528114, 137.84435), (173.528114, 135.548413), (173.528114, 133.252475), (173.528114, 130.956537), (173.528114, 128.6606), (173.528114, 126.364663), (173.528114, 124.068725), (173.528114, 121.772788), (173.528114, 119.47685), (173.528114, 117.180913), (173.528114, 114.884975), (173.528114, 112.589038), (173.528114, 110.2931)], [(164.207, 183.7631), (164.207, 181.467163), (164.207, 179.171225), (164.207, 176.875288), (164.207, 174.57935), (164.207, 172.283412), (164.207, 169.987475), (164.207, 167.691537), (164.207, 165.3956), (164.207, 163.099662), (164.207, 160.803725), (164.207, 158.507788), (164.207, 156.21185), (164.207, 153.915913), (164.207, 151.619975), (164.207, 149.324038), (164.207, 147.0281), (164.207, 144.732162), (164.207, 142.436225), (164.207, 140.140287), (164.207, 137.84435), (164.207, 135.548413), (164.207, 133.252475), (164.207, 130.956537), (164.207, 128.6606), (164.207, 126.364663), (164.207, 124.068725), (164.207, 121.772788), (164.207, 119.47685), (164.207, 117.180913), (164.207, 114.884975), (164.207, 112.589038), (164.207, 110.2931)], [(164.207, 183.7631), (173.528114, 183.7631)], [(164.207, 110.2931), (173.528114, 110.2931)]])\nVISIBLE_CIRCLES = [(113.472, 147.0281, 36.735)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (113.472, 147.0281), 36.735, 45), ('horizontal', '12.687', (173.5281, 147.0281), (164.2069, 147.0281), (168.8675, 136.0281))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0049_00494306_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0050_00508731","images":["images/0050_00508731.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 395.83 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1938151260504332\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.604644, 143.513843), (84.210316, 143.513843), (84.815988, 143.513843), (85.421661, 143.513843), (86.027333, 143.513843), (86.633005, 143.513843), (87.238677, 143.513843), (87.84435, 143.513843), (88.450022, 143.513843), (89.055694, 143.513843), (89.661366, 143.513843), (90.267039, 143.513843), (90.872711, 143.513843), (91.478383, 143.513843), (92.084055, 143.513843), (92.689728, 143.513843), (93.2954, 143.513843), (93.901072, 143.513843), (94.506745, 143.513843), (95.112417, 143.513843), (95.718089, 143.513843), (96.323761, 143.513843), (96.929434, 143.513843), (97.535106, 143.513843), (98.140778, 143.513843), (98.74645, 143.513843), (99.352123, 143.513843), (99.957795, 143.513843), (100.563467, 143.513843), (101.169139, 143.513843), (101.774812, 143.513843), (102.380484, 143.513843), (102.986156, 143.513843), (102.986156, 66.795356)], [(83.604644, 66.795356), (84.210316, 66.795356), (84.815988, 66.795356), (85.421661, 66.795356), (86.027333, 66.795356), (86.633005, 66.795356), (87.238677, 66.795356), (87.84435, 66.795356), (88.450022, 66.795356), (89.055694, 66.795356), (89.661366, 66.795356), (90.267039, 66.795356), (90.872711, 66.795356), (91.478383, 66.795356), (92.084055, 66.795356), (92.689728, 66.795356), (93.2954, 66.795356), (93.901072, 66.795356), (94.506745, 66.795356), (95.112417, 66.795356), (95.718089, 66.795356), (96.323761, 66.795356), (96.929434, 66.795356), (97.535106, 66.795356), (98.140778, 66.795356), (98.74645, 66.795356), (99.352123, 66.795356), (99.957795, 66.795356), (100.563467, 66.795356), (101.169139, 66.795356), (101.774812, 66.795356), (102.380484, 66.795356), (102.986156, 66.795356)], [(83.604644, 66.795356), (83.604644, 143.513843)], [(193.704644, 176.895356), (193.704644, 176.289684), (193.704644, 175.684012), (193.704644, 175.078339), (193.704644, 174.472667), (193.704644, 173.866995), (193.704644, 173.261323), (193.704644, 172.65565), (193.704644, 172.049978), (193.704644, 171.444306), (193.704644, 170.838634), (193.704644, 170.232961), (193.704644, 169.627289), (193.704644, 169.021617), (193.704644, 168.415945), (193.704644, 167.810272), (193.704644, 167.2046), (193.704644, 166.598928), (193.704644, 165.993255), (193.704644, 165.387583), (193.704644, 164.781911), (193.704644, 164.176239), (193.704644, 163.570566), (193.704644, 162.964894), (193.704644, 162.359222), (193.704644, 161.75355), (193.704644, 161.147877), (193.704644, 160.542205), (193.704644, 159.936533), (193.704644, 159.330861), (193.704644, 158.725188), (193.704644, 158.119516), (193.704644, 157.513844)], [(116.986157, 176.895356), (116.986157, 176.289684), (116.986157, 175.684012), (116.986157, 175.078339), (116.986157, 174.472667), (116.986157, 173.866995), (116.986157, 173.261323), (116.986157, 172.65565), (116.986157, 172.049978), (116.986157, 171.444306), (116.986157, 170.838634), (116.986157, 170.232961), (116.986157, 169.627289), (116.986157, 169.021617), (116.986157, 168.415945), (116.986157, 167.810272), (116.986157, 167.2046), (116.986157, 166.598928), (116.986157, 165.993255), (116.986157, 165.387583), (116.986157, 164.781911), (116.986157, 164.176239), (116.986157, 163.570566), (116.986157, 162.964894), (116.986157, 162.359222), (116.986157, 161.75355), (116.986157, 161.147877), (116.986157, 160.542205), (116.986157, 159.936533), (116.986157, 159.330861), (116.986157, 158.725188), (116.986157, 158.119516), (116.986157, 157.513844)], [(116.986157, 176.895356), (193.704644, 176.895356)], [(116.986157, 157.513844), (193.704644, 157.513844)]])\nVISIBLE_CIRCLES = [(93.2954, 167.2046, 9.690756)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.2954, 167.2046), 9.6908, 45), ('horizontal', '395.833', (193.7046, 167.2046), (116.9861, 167.2046), (155.3454, 156.2046))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0050_00508731_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00524005","images":["images/0052_00524005.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 131.94 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.41432335329342107\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(119.524268, 72.308067), (118.229507, 72.308067), (116.934747, 72.308067), (115.639986, 72.308067), (114.345226, 72.308067), (113.050465, 72.308067), (111.755705, 72.308067), (110.460944, 72.308067), (109.166184, 72.308067), (107.871423, 72.308067), (106.576663, 72.308067), (105.281902, 72.308067), (103.987142, 72.308067), (102.692381, 72.308067), (101.397621, 72.308067), (100.10286, 72.308067), (98.8081, 72.308067), (97.51334, 72.308067), (96.218579, 72.308067), (94.923819, 72.308067), (93.629058, 72.308067), (92.334298, 72.308067), (91.039537, 72.308067), (89.744777, 72.308067), (88.450016, 72.308067), (87.155256, 72.308067), (85.860495, 72.308067), (84.565735, 72.308067), (83.270974, 72.308067), (81.976214, 72.308067), (80.681453, 72.308067), (79.386693, 72.308067), (78.091932, 72.308067)], [(119.524268, 72.308067), (119.524268, 126.975732), (118.229507, 126.975732), (116.934747, 126.975732), (115.639986, 126.975732), (114.345226, 126.975732), (113.050465, 126.975732), (111.755705, 126.975732), (110.460944, 126.975732), (109.166184, 126.975732), (107.871423, 126.975732), (106.576663, 126.975732), (105.281902, 126.975732), (103.987142, 126.975732), (102.692381, 126.975732), (101.397621, 126.975732), (100.10286, 126.975732), (98.8081, 126.975732), (97.51334, 126.975732), (96.218579, 126.975732), (94.923819, 126.975732), (93.629058, 126.975732), (92.334298, 126.975732), (91.039537, 126.975732), (89.744777, 126.975732), (88.450016, 126.975732), (87.155256, 126.975732), (85.860495, 126.975732), (84.565735, 126.975732), (83.270974, 126.975732), (81.976214, 126.975732), (80.681453, 126.975732), (79.386693, 126.975732), (78.091932, 126.975732), (78.091932, 72.308067)], [(133.524268, 140.975732), (133.524268, 142.270493), (133.524268, 143.565253), (133.524268, 144.860014), (133.524268, 146.154774), (133.524268, 147.449535), (133.524268, 148.744295), (133.524268, 150.039056), (133.524268, 151.333816), (133.524268, 152.628577), (133.524268, 153.923337), (133.524268, 155.218098), (133.524268, 156.512858), (133.524268, 157.807619), (133.524268, 159.102379), (133.524268, 160.39714), (133.524268, 161.6919), (133.524268, 162.98666), (133.524268, 164.281421), (133.524268, 165.576181), (133.524268, 166.870942), (133.524268, 168.165702), (133.524268, 169.460463), (133.524268, 170.755223), (133.524268, 172.049984), (133.524268, 173.344744), (133.524268, 174.639505), (133.524268, 175.934265), (133.524268, 177.229026), (133.524268, 178.523786), (133.524268, 179.818547), (133.524268, 181.113307), (133.524268, 182.408068)], [(188.191933, 140.975732), (188.191933, 142.270493), (188.191933, 143.565253), (188.191933, 144.860014), (188.191933, 146.154774), (188.191933, 147.449535), (188.191933, 148.744295), (188.191933, 150.039056), (188.191933, 151.333816), (188.191933, 152.628577), (188.191933, 153.923337), (188.191933, 155.218098), (188.191933, 156.512858), (188.191933, 157.807619), (188.191933, 159.102379), (188.191933, 160.39714), (188.191933, 161.6919), (188.191933, 162.98666), (188.191933, 164.281421), (188.191933, 165.576181), (188.191933, 166.870942), (188.191933, 168.165702), (188.191933, 169.460463), (188.191933, 170.755223), (188.191933, 172.049984), (188.191933, 173.344744), (188.191933, 174.639505), (188.191933, 175.934265), (188.191933, 177.229026), (188.191933, 178.523786), (188.191933, 179.818547), (188.191933, 181.113307), (188.191933, 182.408068)], [(188.191933, 140.975732), (133.524268, 140.975732)], [(188.191933, 182.408068), (133.524268, 182.408068)]])\nVISIBLE_CIRCLES = [(98.8081, 161.6919, 20.716168)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (98.8081, 161.6919), 20.7162, 45), ('horizontal', '131.944', (133.5243, 161.6919), (188.1919, 161.6919), (160.8581, 172.6919))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00524005_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00526001","images":["images/0052_00526001.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 413.043 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.767122, 144.001522), (84.352477, 144.001522), (84.937832, 144.001522), (85.523187, 144.001522), (86.108542, 144.001522), (86.693896, 144.001522), (87.279251, 144.001522), (87.864606, 144.001522), (88.449961, 144.001522), (89.035316, 144.001522), (89.620671, 144.001522), (90.206026, 144.001522), (90.791381, 144.001522), (91.376735, 144.001522), (91.96209, 144.001522), (92.547445, 144.001522), (93.1328, 144.001522), (93.718155, 144.001522), (94.30351, 144.001522), (94.888865, 144.001522), (95.474219, 144.001522), (96.059574, 144.001522), (96.644929, 144.001522), (97.230284, 144.001522), (97.815639, 144.001522), (98.400994, 144.001522), (98.986349, 144.001522), (99.571704, 144.001522), (100.157058, 144.001522), (100.742413, 144.001522), (101.327768, 144.001522), (101.913123, 144.001522), (102.498478, 144.001522), (102.498478, 66.632878)], [(83.767122, 66.632878), (84.352477, 66.632878), (84.937832, 66.632878), (85.523187, 66.632878), (86.108542, 66.632878), (86.693896, 66.632878), (87.279251, 66.632878), (87.864606, 66.632878), (88.449961, 66.632878), (89.035316, 66.632878), (89.620671, 66.632878), (90.206026, 66.632878), (90.791381, 66.632878), (91.376735, 66.632878), (91.96209, 66.632878), (92.547445, 66.632878), (93.1328, 66.632878), (93.718155, 66.632878), (94.30351, 66.632878), (94.888865, 66.632878), (95.474219, 66.632878), (96.059574, 66.632878), (96.644929, 66.632878), (97.230284, 66.632878), (97.815639, 66.632878), (98.400994, 66.632878), (98.986349, 66.632878), (99.571704, 66.632878), (100.157058, 66.632878), (100.742413, 66.632878), (101.327768, 66.632878), (101.913123, 66.632878), (102.498478, 66.632878)], [(83.767122, 144.001522), (83.767122, 66.632878)], [(193.867122, 176.732878), (193.867122, 176.147523), (193.867122, 175.562168), (193.867122, 174.976813), (193.867122, 174.391458), (193.867122, 173.806104), (193.867122, 173.220749), (193.867122, 172.635394), (193.867122, 172.050039), (193.867122, 171.464684), (193.867122, 170.879329), (193.867122, 170.293974), (193.867122, 169.708619), (193.867122, 169.123265), (193.867122, 168.53791), (193.867122, 167.952555), (193.867122, 167.3672), (193.867122, 166.781845), (193.867122, 166.19649), (193.867122, 165.611135), (193.867122, 165.025781), (193.867122, 164.440426), (193.867122, 163.855071), (193.867122, 163.269716), (193.867122, 162.684361), (193.867122, 162.099006), (193.867122, 161.513651), (193.867122, 160.928296), (193.867122, 160.342942), (193.867122, 159.757587), (193.867122, 159.172232), (193.867122, 158.586877), (193.867122, 158.001522)], [(116.498478, 176.732878), (116.498478, 176.147523), (116.498478, 175.562168), (116.498478, 174.976813), (116.498478, 174.391458), (116.498478, 173.806104), (116.498478, 173.220749), (116.498478, 172.635394), (116.498478, 172.050039), (116.498478, 171.464684), (116.498478, 170.879329), (116.498478, 170.293974), (116.498478, 169.708619), (116.498478, 169.123265), (116.498478, 168.53791), (116.498478, 167.952555), (116.498478, 167.3672), (116.498478, 166.781845), (116.498478, 166.19649), (116.498478, 165.611135), (116.498478, 165.025781), (116.498478, 164.440426), (116.498478, 163.855071), (116.498478, 163.269716), (116.498478, 162.684361), (116.498478, 162.099006), (116.498478, 161.513651), (116.498478, 160.928296), (116.498478, 160.342942), (116.498478, 159.757587), (116.498478, 159.172232), (116.498478, 158.586877), (116.498478, 158.001522)], [(193.867122, 158.001522), (116.498478, 158.001522)], [(193.867122, 176.732878), (116.498478, 176.732878)]])\nVISIBLE_CIRCLES = [(93.1328, 167.3672, 9.365678)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45), ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00526001_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0054_00540384","images":["images/0054_00540384.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 413.04 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18731355932203375\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(102.498478, 66.632878), (101.913123, 66.632878), (101.327768, 66.632878), (100.742413, 66.632878), (100.157058, 66.632878), (99.571704, 66.632878), (98.986349, 66.632878), (98.400994, 66.632878), (97.815639, 66.632878), (97.230284, 66.632878), (96.644929, 66.632878), (96.059574, 66.632878), (95.474219, 66.632878), (94.888865, 66.632878), (94.30351, 66.632878), (93.718155, 66.632878), (93.1328, 66.632878), (92.547445, 66.632878), (91.96209, 66.632878), (91.376735, 66.632878), (90.791381, 66.632878), (90.206026, 66.632878), (89.620671, 66.632878), (89.035316, 66.632878), (88.449961, 66.632878), (87.864606, 66.632878), (87.279251, 66.632878), (86.693896, 66.632878), (86.108542, 66.632878), (85.523187, 66.632878), (84.937832, 66.632878), (84.352477, 66.632878), (83.767122, 66.632878)], [(102.498478, 66.632878), (102.498478, 144.001522), (101.913123, 144.001522), (101.327768, 144.001522), (100.742413, 144.001522), (100.157058, 144.001522), (99.571704, 144.001522), (98.986349, 144.001522), (98.400994, 144.001522), (97.815639, 144.001522), (97.230284, 144.001522), (96.644929, 144.001522), (96.059574, 144.001522), (95.474219, 144.001522), (94.888865, 144.001522), (94.30351, 144.001522), (93.718155, 144.001522), (93.1328, 144.001522), (92.547445, 144.001522), (91.96209, 144.001522), (91.376735, 144.001522), (90.791381, 144.001522), (90.206026, 144.001522), (89.620671, 144.001522), (89.035316, 144.001522), (88.449961, 144.001522), (87.864606, 144.001522), (87.279251, 144.001522), (86.693896, 144.001522), (86.108542, 144.001522), (85.523187, 144.001522), (84.937832, 144.001522), (84.352477, 144.001522), (83.767122, 144.001522), (83.767122, 66.632878)], [(116.498478, 158.001522), (116.498478, 158.586877), (116.498478, 159.172232), (116.498478, 159.757587), (116.498478, 160.342942), (116.498478, 160.928296), (116.498478, 161.513651), (116.498478, 162.099006), (116.498478, 162.684361), (116.498478, 163.269716), (116.498478, 163.855071), (116.498478, 164.440426), (116.498478, 165.025781), (116.498478, 165.611135), (116.498478, 166.19649), (116.498478, 166.781845), (116.498478, 167.3672), (116.498478, 167.952555), (116.498478, 168.53791), (116.498478, 169.123265), (116.498478, 169.708619), (116.498478, 170.293974), (116.498478, 170.879329), (116.498478, 171.464684), (116.498478, 172.050039), (116.498478, 172.635394), (116.498478, 173.220749), (116.498478, 173.806104), (116.498478, 174.391458), (116.498478, 174.976813), (116.498478, 175.562168), (116.498478, 176.147523), (116.498478, 176.732878)], [(193.867122, 158.001522), (193.867122, 158.586877), (193.867122, 159.172232), (193.867122, 159.757587), (193.867122, 160.342942), (193.867122, 160.928296), (193.867122, 161.513651), (193.867122, 162.099006), (193.867122, 162.684361), (193.867122, 163.269716), (193.867122, 163.855071), (193.867122, 164.440426), (193.867122, 165.025781), (193.867122, 165.611135), (193.867122, 166.19649), (193.867122, 166.781845), (193.867122, 167.3672), (193.867122, 167.952555), (193.867122, 168.53791), (193.867122, 169.123265), (193.867122, 169.708619), (193.867122, 170.293974), (193.867122, 170.879329), (193.867122, 171.464684), (193.867122, 172.050039), (193.867122, 172.635394), (193.867122, 173.220749), (193.867122, 173.806104), (193.867122, 174.391458), (193.867122, 174.976813), (193.867122, 175.562168), (193.867122, 176.147523), (193.867122, 176.732878)], [(193.867122, 158.001522), (116.498478, 158.001522)], [(193.867122, 176.732878), (116.498478, 176.732878)]])\nVISIBLE_CIRCLES = [(93.1328, 167.3672, 9.365678)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45), ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0054_00540384_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0056_00568843","images":["images/0056_00568843.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 158.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3720000000000049\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(116.35, 71.25), (115.1875, 71.25), (114.025, 71.25), (112.8625, 71.25), (111.7, 71.25), (110.5375, 71.25), (109.375, 71.25), (108.2125, 71.25), (107.05, 71.25), (105.8875, 71.25), (104.725, 71.25), (103.5625, 71.25), (102.4, 71.25), (101.2375, 71.25), (100.075, 71.25), (98.9125, 71.25), (97.75, 71.25), (96.5875, 71.25), (95.425, 71.25), (94.2625, 71.25), (93.1, 71.25), (91.9375, 71.25), (90.775, 71.25), (89.6125, 71.25), (88.45, 71.25), (87.2875, 71.25), (86.125, 71.25), (84.9625, 71.25), (83.8, 71.25), (82.6375, 71.25), (81.475, 71.25), (80.3125, 71.25), (79.15, 71.25)], [(116.35, 71.25), (116.35, 130.15), (115.1875, 130.15), (114.025, 130.15), (112.8625, 130.15), (111.7, 130.15), (110.5375, 130.15), (109.375, 130.15), (108.2125, 130.15), (107.05, 130.15), (105.8875, 130.15), (104.725, 130.15), (103.5625, 130.15), (102.4, 130.15), (101.2375, 130.15), (100.075, 130.15), (98.9125, 130.15), (97.75, 130.15), (96.5875, 130.15), (95.425, 130.15), (94.2625, 130.15), (93.1, 130.15), (91.9375, 130.15), (90.775, 130.15), (89.6125, 130.15), (88.45, 130.15), (87.2875, 130.15), (86.125, 130.15), (84.9625, 130.15), (83.8, 130.15), (82.6375, 130.15), (81.475, 130.15), (80.3125, 130.15), (79.15, 130.15), (79.15, 71.25)], [(130.35, 144.15), (130.35, 145.3125), (130.35, 146.475), (130.35, 147.6375), (130.35, 148.8), (130.35, 149.9625), (130.35, 151.125), (130.35, 152.2875), (130.35, 153.45), (130.35, 154.6125), (130.35, 155.775), (130.35, 156.9375), (130.35, 158.1), (130.35, 159.2625), (130.35, 160.425), (130.35, 161.5875), (130.35, 162.75), (130.35, 163.9125), (130.35, 165.075), (130.35, 166.2375), (130.35, 167.4), (130.35, 168.5625), (130.35, 169.725), (130.35, 170.8875), (130.35, 172.05), (130.35, 173.2125), (130.35, 174.375), (130.35, 175.5375), (130.35, 176.7), (130.35, 177.8625), (130.35, 179.025), (130.35, 180.1875), (130.35, 181.35)], [(189.25, 144.15), (189.25, 145.3125), (189.25, 146.475), (189.25, 147.6375), (189.25, 148.8), (189.25, 149.9625), (189.25, 151.125), (189.25, 152.2875), (189.25, 153.45), (189.25, 154.6125), (189.25, 155.775), (189.25, 156.9375), (189.25, 158.1), (189.25, 159.2625), (189.25, 160.425), (189.25, 161.5875), (189.25, 162.75), (189.25, 163.9125), (189.25, 165.075), (189.25, 166.2375), (189.25, 167.4), (189.25, 168.5625), (189.25, 169.725), (189.25, 170.8875), (189.25, 172.05), (189.25, 173.2125), (189.25, 174.375), (189.25, 175.5375), (189.25, 176.7), (189.25, 177.8625), (189.25, 179.025), (189.25, 180.1875), (189.25, 181.35)], [(189.25, 144.15), (130.35, 144.15)], [(189.25, 181.35), (130.35, 181.35)]])\nVISIBLE_CIRCLES = [(97.75, 162.75, 18.6)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (97.75, 162.75), 18.6, 45), ('horizontal', '158.333', (130.35, 162.75), (189.25, 162.75), (159.8, 173.75))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0056_00568843_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0068_00686899","images":["images/0068_00686899.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 28.27 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7491786542923407\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(144.638333, 80.679433), (142.297149, 80.679433), (139.955966, 80.679433), (137.614783, 80.679433), (135.2736, 80.679433), (132.932416, 80.679433), (130.591233, 80.679433), (128.25005, 80.679433), (125.908866, 80.679433), (123.567683, 80.679433), (121.2265, 80.679433), (118.885316, 80.679433), (116.544133, 80.679433), (114.20295, 80.679433), (111.861767, 80.679433), (109.520583, 80.679433), (107.1794, 80.679433), (104.838217, 80.679433), (102.497033, 80.679433), (100.15585, 80.679433), (97.814667, 80.679433), (95.473484, 80.679433), (93.1323, 80.679433), (90.791117, 80.679433), (88.449934, 80.679433), (86.10875, 80.679433), (83.767567, 80.679433), (81.426384, 80.679433), (79.0852, 80.679433), (76.744017, 80.679433), (74.402834, 80.679433), (72.061651, 80.679433), (69.720467, 80.679433)], [(144.638333, 80.679433), (144.638333, 101.861567), (142.297149, 101.861567), (139.955966, 101.861567), (137.614783, 101.861567), (135.2736, 101.861567), (132.932416, 101.861567), (130.591233, 101.861567), (128.25005, 101.861567), (125.908866, 101.861567), (123.567683, 101.861567), (121.2265, 101.861567), (118.885316, 101.861567), (116.544133, 101.861567), (114.20295, 101.861567), (111.861767, 101.861567), (109.520583, 101.861567), (107.1794, 101.861567), (104.838217, 101.861567), (102.497033, 101.861567), (100.15585, 101.861567), (97.814667, 101.861567), (95.473484, 101.861567), (93.1323, 101.861567), (90.791117, 101.861567), (88.449934, 101.861567), (86.10875, 101.861567), (83.767567, 101.861567), (81.426384, 101.861567), (79.0852, 101.861567), (76.744017, 101.861567), (74.402834, 101.861567), (72.061651, 101.861567), (69.720467, 101.861567), (69.720467, 80.679433)], [(158.638333, 115.861567), (158.638333, 118.202751), (158.638333, 120.543934), (158.638333, 122.885117), (158.638333, 125.2263), (158.638333, 127.567484), (158.638333, 129.908667), (158.638333, 132.24985), (158.638333, 134.591034), (158.638333, 136.932217), (158.638333, 139.2734), (158.638333, 141.614584), (158.638333, 143.955767), (158.638333, 146.29695), (158.638333, 148.638133), (158.638333, 150.979317), (158.638333, 153.3205), (158.638333, 155.661683), (158.638333, 158.002867), (158.638333, 160.34405), (158.638333, 162.685233), (158.638333, 165.026416), (158.638333, 167.3676), (158.638333, 169.708783), (158.638333, 172.049966), (158.638333, 174.39115), (158.638333, 176.732333), (158.638333, 179.073516), (158.638333, 181.4147), (158.638333, 183.755883), (158.638333, 186.097066), (158.638333, 188.438249), (158.638333, 190.779433)], [(179.820467, 115.861567), (179.820467, 118.202751), (179.820467, 120.543934), (179.820467, 122.885117), (179.820467, 125.2263), (179.820467, 127.567484), (179.820467, 129.908667), (179.820467, 132.24985), (179.820467, 134.591034), (179.820467, 136.932217), (179.820467, 139.2734), (179.820467, 141.614584), (179.820467, 143.955767), (179.820467, 146.29695), (179.820467, 148.638133), (179.820467, 150.979317), (179.820467, 153.3205), (179.820467, 155.661683), (179.820467, 158.002867), (179.820467, 160.34405), (179.820467, 162.685233), (179.820467, 165.026416), (179.820467, 167.3676), (179.820467, 169.708783), (179.820467, 172.049966), (179.820467, 174.39115), (179.820467, 176.732333), (179.820467, 179.073516), (179.820467, 181.4147), (179.820467, 183.755883), (179.820467, 186.097066), (179.820467, 188.438249), (179.820467, 190.779433)], [(179.820467, 115.861567), (158.638333, 115.861567)], [(179.820467, 190.779433), (158.638333, 190.779433)]])\nVISIBLE_CIRCLES = [(107.1794, 153.3205, 37.458933)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (107.1794, 153.3205), 37.4589, 45), ('horizontal', '28.2738', (158.6384, 153.3205), (179.8205, 153.3205), (169.2295, 164.3205))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0068_00686899_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0068_00687405","images":["images/0068_00687405.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 413.043 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18731355932203736\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.767122, 144.001522), (84.352477, 144.001522), (84.937832, 144.001522), (85.523187, 144.001522), (86.108542, 144.001522), (86.693896, 144.001522), (87.279251, 144.001522), (87.864606, 144.001522), (88.449961, 144.001522), (89.035316, 144.001522), (89.620671, 144.001522), (90.206026, 144.001522), (90.791381, 144.001522), (91.376735, 144.001522), (91.96209, 144.001522), (92.547445, 144.001522), (93.1328, 144.001522), (93.718155, 144.001522), (94.30351, 144.001522), (94.888865, 144.001522), (95.474219, 144.001522), (96.059574, 144.001522), (96.644929, 144.001522), (97.230284, 144.001522), (97.815639, 144.001522), (98.400994, 144.001522), (98.986349, 144.001522), (99.571704, 144.001522), (100.157058, 144.001522), (100.742413, 144.001522), (101.327768, 144.001522), (101.913123, 144.001522), (102.498478, 144.001522), (102.498478, 66.632878)], [(83.767122, 66.632878), (84.352477, 66.632878), (84.937832, 66.632878), (85.523187, 66.632878), (86.108542, 66.632878), (86.693896, 66.632878), (87.279251, 66.632878), (87.864606, 66.632878), (88.449961, 66.632878), (89.035316, 66.632878), (89.620671, 66.632878), (90.206026, 66.632878), (90.791381, 66.632878), (91.376735, 66.632878), (91.96209, 66.632878), (92.547445, 66.632878), (93.1328, 66.632878), (93.718155, 66.632878), (94.30351, 66.632878), (94.888865, 66.632878), (95.474219, 66.632878), (96.059574, 66.632878), (96.644929, 66.632878), (97.230284, 66.632878), (97.815639, 66.632878), (98.400994, 66.632878), (98.986349, 66.632878), (99.571704, 66.632878), (100.157058, 66.632878), (100.742413, 66.632878), (101.327768, 66.632878), (101.913123, 66.632878), (102.498478, 66.632878)], [(83.767122, 144.001522), (83.767122, 66.632878)], [(193.867122, 176.732878), (193.867122, 176.147523), (193.867122, 175.562168), (193.867122, 174.976813), (193.867122, 174.391458), (193.867122, 173.806104), (193.867122, 173.220749), (193.867122, 172.635394), (193.867122, 172.050039), (193.867122, 171.464684), (193.867122, 170.879329), (193.867122, 170.293974), (193.867122, 169.708619), (193.867122, 169.123265), (193.867122, 168.53791), (193.867122, 167.952555), (193.867122, 167.3672), (193.867122, 166.781845), (193.867122, 166.19649), (193.867122, 165.611135), (193.867122, 165.025781), (193.867122, 164.440426), (193.867122, 163.855071), (193.867122, 163.269716), (193.867122, 162.684361), (193.867122, 162.099006), (193.867122, 161.513651), (193.867122, 160.928296), (193.867122, 160.342942), (193.867122, 159.757587), (193.867122, 159.172232), (193.867122, 158.586877), (193.867122, 158.001522)], [(116.498478, 176.732878), (116.498478, 176.147523), (116.498478, 175.562168), (116.498478, 174.976813), (116.498478, 174.391458), (116.498478, 173.806104), (116.498478, 173.220749), (116.498478, 172.635394), (116.498478, 172.050039), (116.498478, 171.464684), (116.498478, 170.879329), (116.498478, 170.293974), (116.498478, 169.708619), (116.498478, 169.123265), (116.498478, 168.53791), (116.498478, 167.952555), (116.498478, 167.3672), (116.498478, 166.781845), (116.498478, 166.19649), (116.498478, 165.611135), (116.498478, 165.025781), (116.498478, 164.440426), (116.498478, 163.855071), (116.498478, 163.269716), (116.498478, 162.684361), (116.498478, 162.099006), (116.498478, 161.513651), (116.498478, 160.928296), (116.498478, 160.342942), (116.498478, 159.757587), (116.498478, 159.172232), (116.498478, 158.586877), (116.498478, 158.001522)], [(193.867122, 158.001522), (116.498478, 158.001522)], [(193.867122, 176.732878), (116.498478, 176.732878)]])\nVISIBLE_CIRCLES = [(93.1328, 167.3672, 9.365678)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (93.1328, 167.3672), 9.3657, 45), ('horizontal', '413.043', (116.4985, 167.3672), (193.8672, 167.3672), (155.1828, 178.3672))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0068_00687405_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0070_00708719","images":["images/0070_00708719.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 431.82 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18070085470085534\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(102.002543, 66.467543), (101.437853, 66.467543), (100.873162, 66.467543), (100.308472, 66.467543), (99.743782, 66.467543), (99.179092, 66.467543), (98.614402, 66.467543), (98.049712, 66.467543), (97.485021, 66.467543), (96.920331, 66.467543), (96.355641, 66.467543), (95.790951, 66.467543), (95.226261, 66.467543), (94.661571, 66.467543), (94.09688, 66.467543), (93.53219, 66.467543), (92.9675, 66.467543), (92.40281, 66.467543), (91.83812, 66.467543), (91.273429, 66.467543), (90.708739, 66.467543), (90.144049, 66.467543), (89.579359, 66.467543), (89.014669, 66.467543), (88.449979, 66.467543), (87.885288, 66.467543), (87.320598, 66.467543), (86.755908, 66.467543), (86.191218, 66.467543), (85.626528, 66.467543), (85.061838, 66.467543), (84.497147, 66.467543), (83.932457, 66.467543)], [(102.002543, 66.467543), (102.002543, 144.497457), (101.437853, 144.497457), (100.873162, 144.497457), (100.308472, 144.497457), (99.743782, 144.497457), (99.179092, 144.497457), (98.614402, 144.497457), (98.049712, 144.497457), (97.485021, 144.497457), (96.920331, 144.497457), (96.355641, 144.497457), (95.790951, 144.497457), (95.226261, 144.497457), (94.661571, 144.497457), (94.09688, 144.497457), (93.53219, 144.497457), (92.9675, 144.497457), (92.40281, 144.497457), (91.83812, 144.497457), (91.273429, 144.497457), (90.708739, 144.497457), (90.144049, 144.497457), (89.579359, 144.497457), (89.014669, 144.497457), (88.449979, 144.497457), (87.885288, 144.497457), (87.320598, 144.497457), (86.755908, 144.497457), (86.191218, 144.497457), (85.626528, 144.497457), (85.061838, 144.497457), (84.497147, 144.497457), (83.932457, 144.497457), (83.932457, 66.467543)], [(116.002543, 158.497457), (116.002543, 159.062147), (116.002543, 159.626838), (116.002543, 160.191528), (116.002543, 160.756218), (116.002543, 161.320908), (116.002543, 161.885598), (116.002543, 162.450288), (116.002543, 163.014979), (116.002543, 163.579669), (116.002543, 164.144359), (116.002543, 164.709049), (116.002543, 165.273739), (116.002543, 165.838429), (116.002543, 166.40312), (116.002543, 166.96781), (116.002543, 167.5325), (116.002543, 168.09719), (116.002543, 168.66188), (116.002543, 169.226571), (116.002543, 169.791261), (116.002543, 170.355951), (116.002543, 170.920641), (116.002543, 171.485331), (116.002543, 172.050021), (116.002543, 172.614712), (116.002543, 173.179402), (116.002543, 173.744092), (116.002543, 174.308782), (116.002543, 174.873472), (116.002543, 175.438162), (116.002543, 176.002853), (116.002543, 176.567543)], [(194.032457, 158.497457), (194.032457, 159.062147), (194.032457, 159.626838), (194.032457, 160.191528), (194.032457, 160.756218), (194.032457, 161.320908), (194.032457, 161.885598), (194.032457, 162.450288), (194.032457, 163.014979), (194.032457, 163.579669), (194.032457, 164.144359), (194.032457, 164.709049), (194.032457, 165.273739), (194.032457, 165.838429), (194.032457, 166.40312), (194.032457, 166.96781), (194.032457, 167.5325), (194.032457, 168.09719), (194.032457, 168.66188), (194.032457, 169.226571), (194.032457, 169.791261), (194.032457, 170.355951), (194.032457, 170.920641), (194.032457, 171.485331), (194.032457, 172.050021), (194.032457, 172.614712), (194.032457, 173.179402), (194.032457, 173.744092), (194.032457, 174.308782), (194.032457, 174.873472), (194.032457, 175.438162), (194.032457, 176.002853), (194.032457, 176.567543)], [(194.032457, 158.497457), (116.002543, 158.497457)], [(194.032457, 176.567543), (116.002543, 176.567543)]])\nVISIBLE_CIRCLES = [(92.9675, 167.5325, 9.035043)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (92.9675, 167.5325), 9.035, 45), ('horizontal', '431.818', (116.0026, 167.5325), (194.0325, 167.5325), (155.0175, 178.5325))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0070_00708719_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0073_00731389","images":["images/0073_00731389.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 0.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9560723268742927\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(160.155416, 85.851816), (157.16769, 85.851816), (154.179964, 85.851816), (151.192238, 85.851816), (148.204512, 85.851816), (145.216786, 85.851816), (142.22906, 85.851816), (139.241334, 85.851816), (136.253608, 85.851816), (133.265882, 85.851816), (130.278156, 85.851816), (127.29043, 85.851816), (124.302704, 85.851816), (121.314978, 85.851816), (118.327252, 85.851816), (115.339526, 85.851816), (112.3518, 85.851816), (109.364074, 85.851816), (106.376348, 85.851816), (103.388622, 85.851816), (100.400896, 85.851816), (97.41317, 85.851816), (94.425444, 85.851816), (91.437718, 85.851816), (88.449992, 85.851816), (85.462266, 85.851816), (82.47454, 85.851816), (79.486814, 85.851816), (76.499088, 85.851816), (73.511362, 85.851816), (70.523636, 85.851816), (67.53591, 85.851816), (64.548184, 85.851816)], [(160.155416, 85.851816), (160.155416, 86.344583), (157.16769, 86.344583), (154.179964, 86.344583), (151.192238, 86.344583), (148.204512, 86.344583), (145.216786, 86.344583), (142.22906, 86.344583), (139.241334, 86.344583), (136.253608, 86.344583), (133.265882, 86.344583), (130.278156, 86.344583), (127.29043, 86.344583), (124.302704, 86.344583), (121.314978, 86.344583), (118.327252, 86.344583), (115.339526, 86.344583), (112.3518, 86.344583), (109.364074, 86.344583), (106.376348, 86.344583), (103.388622, 86.344583), (100.400896, 86.344583), (97.41317, 86.344583), (94.425444, 86.344583), (91.437718, 86.344583), (88.449992, 86.344583), (85.462266, 86.344583), (82.47454, 86.344583), (79.486814, 86.344583), (76.499088, 86.344583), (73.511362, 86.344583), (70.523636, 86.344583), (67.53591, 86.344583), (64.548184, 86.344583), (64.548184, 85.851816)], [(174.648184, 100.344584), (174.155417, 100.344584)], [(174.648184, 195.951816), (174.155417, 195.951816)]])\nVISIBLE_CIRCLES = [(112.3518, 148.1482, 47.803616)]\nVISIBLE_ARCS = [(-27473.5982, 148.1482, 27647.768518, -0.099066, 0.099066), (-29521.5982, 148.1482, 29696.25862, -0.092232, 0.092232)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (112.3518, 148.1482), 47.8036, 45), ('vertical', '0.5154', (174.1554, 148.1482), (174.6482, 148.1482), (174.4018, 159.1482))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0073_00731389_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0080_00807408","images":["images/0080_00807408.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 431.82 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18070085470088249\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.932457, 144.497457), (84.497147, 144.497457), (85.061838, 144.497457), (85.626528, 144.497457), (86.191218, 144.497457), (86.755908, 144.497457), (87.320598, 144.497457), (87.885288, 144.497457), (88.449979, 144.497457), (89.014669, 144.497457), (89.579359, 144.497457), (90.144049, 144.497457), (90.708739, 144.497457), (91.273429, 144.497457), (91.83812, 144.497457), (92.40281, 144.497457), (92.9675, 144.497457), (93.53219, 144.497457), (94.09688, 144.497457), (94.661571, 144.497457), (95.226261, 144.497457), (95.790951, 144.497457), (96.355641, 144.497457), (96.920331, 144.497457), (97.485021, 144.497457), (98.049712, 144.497457), (98.614402, 144.497457), (99.179092, 144.497457), (99.743782, 144.497457), (100.308472, 144.497457), (100.873162, 144.497457), (101.437853, 144.497457), (102.002543, 144.497457), (102.002543, 66.467543)], [(83.932457, 66.467543), (84.497147, 66.467543), (85.061838, 66.467543), (85.626528, 66.467543), (86.191218, 66.467543), (86.755908, 66.467543), (87.320598, 66.467543), (87.885288, 66.467543), (88.449979, 66.467543), (89.014669, 66.467543), (89.579359, 66.467543), (90.144049, 66.467543), (90.708739, 66.467543), (91.273429, 66.467543), (91.83812, 66.467543), (92.40281, 66.467543), (92.9675, 66.467543), (93.53219, 66.467543), (94.09688, 66.467543), (94.661571, 66.467543), (95.226261, 66.467543), (95.790951, 66.467543), (96.355641, 66.467543), (96.920331, 66.467543), (97.485021, 66.467543), (98.049712, 66.467543), (98.614402, 66.467543), (99.179092, 66.467543), (99.743782, 66.467543), (100.308472, 66.467543), (100.873162, 66.467543), (101.437853, 66.467543), (102.002543, 66.467543)], [(83.932457, 66.467543), (83.932457, 144.497457)], [(194.032457, 176.567543), (194.032457, 176.002853), (194.032457, 175.438162), (194.032457, 174.873472), (194.032457, 174.308782), (194.032457, 173.744092), (194.032457, 173.179402), (194.032457, 172.614712), (194.032457, 172.050021), (194.032457, 171.485331), (194.032457, 170.920641), (194.032457, 170.355951), (194.032457, 169.791261), (194.032457, 169.226571), (194.032457, 168.66188), (194.032457, 168.09719), (194.032457, 167.5325), (194.032457, 166.96781), (194.032457, 166.40312), (194.032457, 165.838429), (194.032457, 165.273739), (194.032457, 164.709049), (194.032457, 164.144359), (194.032457, 163.579669), (194.032457, 163.014979), (194.032457, 162.450288), (194.032457, 161.885598), (194.032457, 161.320908), (194.032457, 160.756218), (194.032457, 160.191528), (194.032457, 159.626838), (194.032457, 159.062147), (194.032457, 158.497457)], [(116.002543, 176.567543), (116.002543, 176.002853), (116.002543, 175.438162), (116.002543, 174.873472), (116.002543, 174.308782), (116.002543, 173.744092), (116.002543, 173.179402), (116.002543, 172.614712), (116.002543, 172.050021), (116.002543, 171.485331), (116.002543, 170.920641), (116.002543, 170.355951), (116.002543, 169.791261), (116.002543, 169.226571), (116.002543, 168.66188), (116.002543, 168.09719), (116.002543, 167.5325), (116.002543, 166.96781), (116.002543, 166.40312), (116.002543, 165.838429), (116.002543, 165.273739), (116.002543, 164.709049), (116.002543, 164.144359), (116.002543, 163.579669), (116.002543, 163.014979), (116.002543, 162.450288), (116.002543, 161.885598), (116.002543, 161.320908), (116.002543, 160.756218), (116.002543, 160.191528), (116.002543, 159.626838), (116.002543, 159.062147), (116.002543, 158.497457)], [(116.002543, 176.567543), (194.032457, 176.567543)], [(116.002543, 158.497457), (194.032457, 158.497457)]])\nVISIBLE_CIRCLES = [(92.9675, 167.5325, 9.035043)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (92.9675, 167.5325), 9.035, 45), ('horizontal', '431.818', (194.0325, 167.5325), (116.0026, 167.5325), (155.0175, 156.5325))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0080_00807408_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00821671","images":["images/0082_00821671.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 197.92 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3225734265734338\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(112.642971, 70.014371), (111.634929, 70.014371), (110.626887, 70.014371), (109.618845, 70.014371), (108.610803, 70.014371), (107.602762, 70.014371), (106.59472, 70.014371), (105.586678, 70.014371), (104.578636, 70.014371), (103.570594, 70.014371), (102.562552, 70.014371), (101.55451, 70.014371), (100.546468, 70.014371), (99.538426, 70.014371), (98.530384, 70.014371), (97.522342, 70.014371), (96.5143, 70.014371), (95.506258, 70.014371), (94.498216, 70.014371), (93.490174, 70.014371), (92.482132, 70.014371), (91.47409, 70.014371), (90.466048, 70.014371), (89.458006, 70.014371), (88.449964, 70.014371), (87.441922, 70.014371), (86.43388, 70.014371), (85.425838, 70.014371), (84.417797, 70.014371), (83.409755, 70.014371), (82.401713, 70.014371), (81.393671, 70.014371), (80.385629, 70.014371)], [(112.642971, 70.014371), (112.642971, 133.857028), (111.634929, 133.857028), (110.626887, 133.857028), (109.618845, 133.857028), (108.610803, 133.857028), (107.602762, 133.857028), (106.59472, 133.857028), (105.586678, 133.857028), (104.578636, 133.857028), (103.570594, 133.857028), (102.562552, 133.857028), (101.55451, 133.857028), (100.546468, 133.857028), (99.538426, 133.857028), (98.530384, 133.857028), (97.522342, 133.857028), (96.5143, 133.857028), (95.506258, 133.857028), (94.498216, 133.857028), (93.490174, 133.857028), (92.482132, 133.857028), (91.47409, 133.857028), (90.466048, 133.857028), (89.458006, 133.857028), (88.449964, 133.857028), (87.441922, 133.857028), (86.43388, 133.857028), (85.425838, 133.857028), (84.417797, 133.857028), (83.409755, 133.857028), (82.401713, 133.857028), (81.393671, 133.857028), (80.385629, 133.857028), (80.385629, 70.014371)], [(126.642972, 147.857029), (126.642972, 148.865071), (126.642972, 149.873113), (126.642972, 150.881155), (126.642972, 151.889197), (126.642972, 152.897238), (126.642972, 153.90528), (126.642972, 154.913322), (126.642972, 155.921364), (126.642972, 156.929406), (126.642972, 157.937448), (126.642972, 158.94549), (126.642972, 159.953532), (126.642972, 160.961574), (126.642972, 161.969616), (126.642972, 162.977658), (126.642972, 163.9857), (126.642972, 164.993742), (126.642972, 166.001784), (126.642972, 167.009826), (126.642972, 168.017868), (126.642972, 169.02591), (126.642972, 170.033952), (126.642972, 171.041994), (126.642972, 172.050036), (126.642972, 173.058078), (126.642972, 174.06612), (126.642972, 175.074162), (126.642972, 176.082203), (126.642972, 177.090245), (126.642972, 178.098287), (126.642972, 179.106329), (126.642972, 180.114371)], [(190.485629, 147.857029), (190.485629, 148.865071), (190.485629, 149.873113), (190.485629, 150.881155), (190.485629, 151.889197), (190.485629, 152.897238), (190.485629, 153.90528), (190.485629, 154.913322), (190.485629, 155.921364), (190.485629, 156.929406), (190.485629, 157.937448), (190.485629, 158.94549), (190.485629, 159.953532), (190.485629, 160.961574), (190.485629, 161.969616), (190.485629, 162.977658), (190.485629, 163.9857), (190.485629, 164.993742), (190.485629, 166.001784), (190.485629, 167.009826), (190.485629, 168.017868), (190.485629, 169.02591), (190.485629, 170.033952), (190.485629, 171.041994), (190.485629, 172.050036), (190.485629, 173.058078), (190.485629, 174.06612), (190.485629, 175.074162), (190.485629, 176.082203), (190.485629, 177.090245), (190.485629, 178.098287), (190.485629, 179.106329), (190.485629, 180.114371)], [(190.485629, 147.857029), (126.642972, 147.857029)], [(190.485629, 180.114371), (126.642972, 180.114371)]])\nVISIBLE_CIRCLES = [(96.5143, 163.9857, 16.128671)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (96.5143, 163.9857), 16.1287, 45), ('horizontal', '197.917', (126.643, 163.9857), (190.4857, 163.9857), (158.5643, 174.9857))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00821671_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00825014","images":["images/0082_00825014.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 791.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.10777570093458023\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(96.533185, 64.644385), (96.196386, 64.644385), (95.859587, 64.644385), (95.522788, 64.644385), (95.185989, 64.644385), (94.84919, 64.644385), (94.512391, 64.644385), (94.175592, 64.644385), (93.838793, 64.644385), (93.501993, 64.644385), (93.165194, 64.644385), (92.828395, 64.644385), (92.491596, 64.644385), (92.154797, 64.644385), (91.817998, 64.644385), (91.481199, 64.644385), (91.1444, 64.644385), (90.807601, 64.644385), (90.470802, 64.644385), (90.134003, 64.644385), (89.797204, 64.644385), (89.460405, 64.644385), (89.123606, 64.644385), (88.786807, 64.644385), (88.450007, 64.644385), (88.113208, 64.644385), (87.776409, 64.644385), (87.43961, 64.644385), (87.102811, 64.644385), (86.766012, 64.644385), (86.429213, 64.644385), (86.092414, 64.644385), (85.755615, 64.644385)], [(96.533185, 64.644385), (96.533185, 149.966815), (96.196386, 149.966815), (95.859587, 149.966815), (95.522788, 149.966815), (95.185989, 149.966815), (94.84919, 149.966815), (94.512391, 149.966815), (94.175592, 149.966815), (93.838793, 149.966815), (93.501993, 149.966815), (93.165194, 149.966815), (92.828395, 149.966815), (92.491596, 149.966815), (92.154797, 149.966815), (91.817998, 149.966815), (91.481199, 149.966815), (91.1444, 149.966815), (90.807601, 149.966815), (90.470802, 149.966815), (90.134003, 149.966815), (89.797204, 149.966815), (89.460405, 149.966815), (89.123606, 149.966815), (88.786807, 149.966815), (88.450007, 149.966815), (88.113208, 149.966815), (87.776409, 149.966815), (87.43961, 149.966815), (87.102811, 149.966815), (86.766012, 149.966815), (86.429213, 149.966815), (86.092414, 149.966815), (85.755615, 149.966815), (85.755615, 64.644385)], [(110.533185, 163.966815), (110.533185, 164.303614), (110.533185, 164.640413), (110.533185, 164.977212), (110.533185, 165.314011), (110.533185, 165.65081), (110.533185, 165.987609), (110.533185, 166.324408), (110.533185, 166.661207), (110.533185, 166.998007), (110.533185, 167.334806), (110.533185, 167.671605), (110.533185, 168.008404), (110.533185, 168.345203), (110.533185, 168.682002), (110.533185, 169.018801), (110.533185, 169.3556), (110.533185, 169.692399), (110.533185, 170.029198), (110.533185, 170.365997), (110.533185, 170.702796), (110.533185, 171.039595), (110.533185, 171.376394), (110.533185, 171.713193), (110.533185, 172.049993), (110.533185, 172.386792), (110.533185, 172.723591), (110.533185, 173.06039), (110.533185, 173.397189), (110.533185, 173.733988), (110.533185, 174.070787), (110.533185, 174.407586), (110.533185, 174.744385)], [(195.855615, 163.966815), (195.855615, 164.303614), (195.855615, 164.640413), (195.855615, 164.977212), (195.855615, 165.314011), (195.855615, 165.65081), (195.855615, 165.987609), (195.855615, 166.324408), (195.855615, 166.661207), (195.855615, 166.998007), (195.855615, 167.334806), (195.855615, 167.671605), (195.855615, 168.008404), (195.855615, 168.345203), (195.855615, 168.682002), (195.855615, 169.018801), (195.855615, 169.3556), (195.855615, 169.692399), (195.855615, 170.029198), (195.855615, 170.365997), (195.855615, 170.702796), (195.855615, 171.039595), (195.855615, 171.376394), (195.855615, 171.713193), (195.855615, 172.049993), (195.855615, 172.386792), (195.855615, 172.723591), (195.855615, 173.06039), (195.855615, 173.397189), (195.855615, 173.733988), (195.855615, 174.070787), (195.855615, 174.407586), (195.855615, 174.744385)], [(195.855615, 163.966815), (110.533185, 163.966815)], [(195.855615, 174.744385), (110.533185, 174.744385)]])\nVISIBLE_CIRCLES = [(91.1444, 169.3556, 5.388785)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (91.1444, 169.3556), 5.3888, 45), ('horizontal', '791.667', (110.5332, 169.3556), (195.8556, 169.3556), (153.1944, 180.3556))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00825014_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0083_00834790","images":["images/0083_00834790.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm. It is extruded to a thickness of 4.211 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(153.3206, 90.085583), (153.3206, 93.1794)], [(79.8506, 93.1794), (82.146537, 93.1794), (84.442475, 93.1794), (86.738412, 93.1794), (89.03435, 93.1794), (91.330287, 93.1794), (93.626225, 93.1794), (95.922162, 93.1794), (98.2181, 93.1794), (100.514038, 93.1794), (102.809975, 93.1794), (105.105913, 93.1794), (107.40185, 93.1794), (109.697788, 93.1794), (111.993725, 93.1794), (114.289663, 93.1794), (116.5856, 93.1794), (118.881537, 93.1794), (121.177475, 93.1794), (123.473412, 93.1794), (125.76935, 93.1794), (128.065288, 93.1794), (130.361225, 93.1794), (132.657163, 93.1794), (134.9531, 93.1794), (137.249038, 93.1794), (139.544975, 93.1794), (141.840913, 93.1794), (144.13685, 93.1794), (146.432788, 93.1794), (148.728725, 93.1794), (151.024663, 93.1794), (153.3206, 93.1794)], [(79.8506, 90.085583), (82.146537, 90.085583), (84.442475, 90.085583), (86.738412, 90.085583), (89.03435, 90.085583), (91.330287, 90.085583), (93.626225, 90.085583), (95.922162, 90.085583), (98.2181, 90.085583), (100.514038, 90.085583), (102.809975, 90.085583), (105.105913, 90.085583), (107.40185, 90.085583), (109.697788, 90.085583), (111.993725, 90.085583), (114.289663, 90.085583), (116.5856, 90.085583), (118.881537, 90.085583), (121.177475, 90.085583), (123.473412, 90.085583), (125.76935, 90.085583), (128.065288, 90.085583), (130.361225, 90.085583), (132.657163, 90.085583), (134.9531, 90.085583), (137.249038, 90.085583), (139.544975, 90.085583), (141.840913, 90.085583), (144.13685, 90.085583), (146.432788, 90.085583), (148.728725, 90.085583), (151.024663, 90.085583), (153.3206, 90.085583)], [(79.8506, 93.1794), (79.8506, 90.085583)], [(170.414417, 180.6494), (170.414417, 178.353463), (170.414417, 176.057525), (170.414417, 173.761587), (170.414417, 171.46565), (170.414417, 169.169713), (170.414417, 166.873775), (170.414417, 164.577837), (170.414417, 162.2819), (170.414417, 159.985962), (170.414417, 157.690025), (170.414417, 155.394088), (170.414417, 153.09815), (170.414417, 150.802213), (170.414417, 148.506275), (170.414417, 146.210338), (170.414417, 143.9144), (170.414417, 141.618462), (170.414417, 139.322525), (170.414417, 137.026588), (170.414417, 134.73065), (170.414417, 132.434713), (170.414417, 130.138775), (170.414417, 127.842838), (170.414417, 125.5469), (170.414417, 123.250963), (170.414417, 120.955025), (170.414417, 118.659088), (170.414417, 116.36315), (170.414417, 114.067213), (170.414417, 111.771275), (170.414417, 109.475338), (170.414417, 107.1794)], [(167.3206, 180.6494), (167.3206, 178.353463), (167.3206, 176.057525), (167.3206, 173.761587), (167.3206, 171.46565), (167.3206, 169.169713), (167.3206, 166.873775), (167.3206, 164.577837), (167.3206, 162.2819), (167.3206, 159.985962), (167.3206, 157.690025), (167.3206, 155.394088), (167.3206, 153.09815), (167.3206, 150.802213), (167.3206, 148.506275), (167.3206, 146.210338), (167.3206, 143.9144), (167.3206, 141.618462), (167.3206, 139.322525), (167.3206, 137.026588), (167.3206, 134.73065), (167.3206, 132.434713), (167.3206, 130.138775), (167.3206, 127.842838), (167.3206, 125.5469), (167.3206, 123.250963), (167.3206, 120.955025), (167.3206, 118.659088), (167.3206, 116.36315), (167.3206, 114.067213), (167.3206, 111.771275), (167.3206, 109.475338), (167.3206, 107.1794)], [(170.414417, 107.1794), (167.3206, 107.1794)], [(170.414417, 180.6494), (167.3206, 180.6494)]])\nVISIBLE_CIRCLES = [(116.5856, 143.9144, 36.735)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (116.5856, 143.9144), 36.735, 45), ('horizontal', '4.211', (167.3206, 143.9144), (170.4144, 143.9144), (168.8675, 154.9144))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0083_00834790_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0001_00013115","images":["images/0001_00013115.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 66.67 mm. It is extruded to a thickness of 4.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(82.944, 93.1472), (85.239937, 93.1472), (87.535875, 93.1472), (89.831812, 93.1472), (92.12775, 93.1472), (94.423687, 93.1472), (96.719625, 93.1472), (99.015563, 93.1472), (101.3115, 93.1472), (103.607438, 93.1472), (105.903375, 93.1472), (108.199313, 93.1472), (110.49525, 93.1472), (112.791188, 93.1472), (115.087125, 93.1472), (117.383063, 93.1472), (119.679, 93.1472), (121.974937, 93.1472), (124.270875, 93.1472), (126.566812, 93.1472), (128.86275, 93.1472), (131.158688, 93.1472), (133.454625, 93.1472), (135.750563, 93.1472), (138.0465, 93.1472), (140.342438, 93.1472), (142.638375, 93.1472), (144.934313, 93.1472), (147.23025, 93.1472), (149.526188, 93.1472), (151.822125, 93.1472), (154.118063, 93.1472), (156.414, 93.1472), (156.414, 90.117838)], [(82.944, 90.117838), (85.239937, 90.117838), (87.535875, 90.117838), (89.831812, 90.117838), (92.12775, 90.117838), (94.423687, 90.117838), (96.719625, 90.117838), (99.015563, 90.117838), (101.3115, 90.117838), (103.607438, 90.117838), (105.903375, 90.117838), (108.199313, 90.117838), (110.49525, 90.117838), (112.791188, 90.117838), (115.087125, 90.117838), (117.383063, 90.117838), (119.679, 90.117838), (121.974937, 90.117838), (124.270875, 90.117838), (126.566812, 90.117838), (128.86275, 90.117838), (131.158688, 90.117838), (133.454625, 90.117838), (135.750563, 90.117838), (138.0465, 90.117838), (140.342438, 90.117838), (142.638375, 90.117838), (144.934313, 90.117838), (147.23025, 90.117838), (149.526188, 90.117838), (151.822125, 90.117838), (154.118063, 90.117838), (156.414, 90.117838)], [(82.944, 90.117838), (82.944, 93.1472)], [(173.443362, 180.6172), (173.443362, 178.321263), (173.443362, 176.025325), (173.443362, 173.729388), (173.443362, 171.43345), (173.443362, 169.137513), (173.443362, 166.841575), (173.443362, 164.545638), (173.443362, 162.2497), (173.443362, 159.953763), (173.443362, 157.657825), (173.443362, 155.361888), (173.443362, 153.06595), (173.443362, 150.770013), (173.443362, 148.474075), (173.443362, 146.178138), (173.443362, 143.8822), (173.443362, 141.586263), (173.443362, 139.290325), (173.443362, 136.994388), (173.443362, 134.69845), (173.443362, 132.402513), (173.443362, 130.106575), (173.443362, 127.810638), (173.443362, 125.5147), (173.443362, 123.218763), (173.443362, 120.922825), (173.443362, 118.626888), (173.443362, 116.33095), (173.443362, 114.035013), (173.443362, 111.739075), (173.443362, 109.443138), (173.443362, 107.1472)], [(170.414, 180.6172), (170.414, 178.321263), (170.414, 176.025325), (170.414, 173.729388), (170.414, 171.43345), (170.414, 169.137513), (170.414, 166.841575), (170.414, 164.545638), (170.414, 162.2497), (170.414, 159.953763), (170.414, 157.657825), (170.414, 155.361888), (170.414, 153.06595), (170.414, 150.770013), (170.414, 148.474075), (170.414, 146.178138), (170.414, 143.8822), (170.414, 141.586263), (170.414, 139.290325), (170.414, 136.994388), (170.414, 134.69845), (170.414, 132.402513), (170.414, 130.106575), (170.414, 127.810638), (170.414, 125.5147), (170.414, 123.218763), (170.414, 120.922825), (170.414, 118.626888), (170.414, 116.33095), (170.414, 114.035013), (170.414, 111.739075), (170.414, 109.443138), (170.414, 107.1472)], [(170.414, 180.6172), (173.443362, 180.6172)], [(170.414, 107.1472), (173.443362, 107.1472)]])\nVISIBLE_CIRCLES = [(119.679, 143.8822, 36.735), (119.679, 143.8822, 24.49)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(144.1691, 90.1178, 144.1691, 93.1472), (95.1891, 93.1472, 95.1891, 90.1178), (170.4141, 119.3922, 173.4434, 119.3922), (170.4141, 168.3722, 173.4434, 168.3722)]\nDIMENSIONS = [('diameter', '%%c100', (119.679, 143.8822), 36.735, 45), ('diameter', '%%c66.6667', (119.679, 143.8822), 24.49, 135), ('horizontal', '4.1233', (173.4434, 143.8822), (170.414, 143.8822), (171.9287, 132.8822))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0001_00013115_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0002_00028333","images":["images/0002_00028333.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 36.17 mm. It is extruded to a thickness of 32.11 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7274306085643575\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(148.81123, 80.13573), (146.53801, 80.13573), (144.264789, 80.13573), (141.991568, 80.13573), (139.718348, 80.13573), (137.445127, 80.13573), (135.171907, 80.13573), (132.898686, 80.13573), (130.625465, 80.13573), (128.352245, 80.13573), (126.079024, 80.13573), (123.805803, 80.13573), (121.532583, 80.13573), (119.259362, 80.13573), (116.986141, 80.13573), (114.712921, 80.13573), (112.4397, 80.13573), (110.166479, 80.13573), (107.893259, 80.13573), (105.620038, 80.13573), (103.346817, 80.13573), (101.073597, 80.13573), (98.800376, 80.13573), (96.527155, 80.13573), (94.253935, 80.13573), (91.980714, 80.13573), (89.707493, 80.13573), (87.434273, 80.13573), (85.161052, 80.13573), (82.887832, 80.13573), (80.614611, 80.13573), (78.34139, 80.13573), (76.06817, 80.13573)], [(148.81123, 80.13573), (148.81123, 103.492669), (146.53801, 103.492669), (144.264789, 103.492669), (141.991568, 103.492669), (139.718348, 103.492669), (137.445127, 103.492669), (135.171907, 103.492669), (132.898686, 103.492669), (130.625465, 103.492669), (128.352245, 103.492669), (126.079024, 103.492669), (123.805803, 103.492669), (121.532583, 103.492669), (119.259362, 103.492669), (116.986141, 103.492669), (114.712921, 103.492669), (112.4397, 103.492669), (110.166479, 103.492669), (107.893259, 103.492669), (105.620038, 103.492669), (103.346817, 103.492669), (101.073597, 103.492669), (98.800376, 103.492669), (96.527155, 103.492669), (94.253935, 103.492669), (91.980714, 103.492669), (89.707493, 103.492669), (87.434273, 103.492669), (85.161052, 103.492669), (82.887832, 103.492669), (80.614611, 103.492669), (78.34139, 103.492669), (76.06817, 103.492669), (76.06817, 80.13573)], [(162.811231, 117.49267), (162.811231, 119.76589), (162.811231, 122.039111), (162.811231, 124.312332), (162.811231, 126.585552), (162.811231, 128.858773), (162.811231, 131.131993), (162.811231, 133.405214), (162.811231, 135.678435), (162.811231, 137.951655), (162.811231, 140.224876), (162.811231, 142.498097), (162.811231, 144.771317), (162.811231, 147.044538), (162.811231, 149.317759), (162.811231, 151.590979), (162.811231, 153.8642), (162.811231, 156.137421), (162.811231, 158.410641), (162.811231, 160.683862), (162.811231, 162.957083), (162.811231, 165.230303), (162.811231, 167.503524), (162.811231, 169.776745), (162.811231, 172.049965), (162.811231, 174.323186), (162.811231, 176.596407), (162.811231, 178.869627), (162.811231, 181.142848), (162.811231, 183.416068), (162.811231, 185.689289), (162.811231, 187.96251), (162.811231, 190.23573)], [(186.16817, 117.49267), (186.16817, 119.76589), (186.16817, 122.039111), (186.16817, 124.312332), (186.16817, 126.585552), (186.16817, 128.858773), (186.16817, 131.131993), (186.16817, 133.405214), (186.16817, 135.678435), (186.16817, 137.951655), (186.16817, 140.224876), (186.16817, 142.498097), (186.16817, 144.771317), (186.16817, 147.044538), (186.16817, 149.317759), (186.16817, 151.590979), (186.16817, 153.8642), (186.16817, 156.137421), (186.16817, 158.410641), (186.16817, 160.683862), (186.16817, 162.957083), (186.16817, 165.230303), (186.16817, 167.503524), (186.16817, 169.776745), (186.16817, 172.049965), (186.16817, 174.323186), (186.16817, 176.596407), (186.16817, 178.869627), (186.16817, 181.142848), (186.16817, 183.416068), (186.16817, 185.689289), (186.16817, 187.96251), (186.16817, 190.23573)], [(186.16817, 117.49267), (162.811231, 117.49267)], [(186.16817, 190.23573), (162.811231, 190.23573)]])\nVISIBLE_CIRCLES = [(112.4397, 153.8642, 36.37153), (112.4397, 153.8642, 13.15566)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(125.5954, 103.4927, 125.5954, 80.1358), (99.2841, 80.1358, 99.2841, 103.4927), (186.1682, 167.0199, 162.8113, 167.0199), (186.1682, 140.7086, 162.8113, 140.7086)]\nDIMENSIONS = [('diameter', '%%c100', (112.4397, 153.8642), 36.3715, 45), ('diameter', '%%c36.1702', (112.4397, 153.8642), 13.1557, 135), ('horizontal', '32.1088', (162.8113, 153.8642), (186.1682, 153.8642), (174.4897, 164.8642))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0002_00028333_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0014_00148034","images":["images/0014_00148034.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 35.42 mm. It is extruded to a thickness of 39.69 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6879695498504659\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(145.601577, 79.149277), (143.451673, 79.149277), (141.301768, 79.149277), (139.151863, 79.149277), (137.001958, 79.149277), (134.852053, 79.149277), (132.702148, 79.149277), (130.552244, 79.149277), (128.402339, 79.149277), (126.252434, 79.149277), (124.102529, 79.149277), (121.952624, 79.149277), (119.802719, 79.149277), (117.652815, 79.149277), (115.50291, 79.149277), (113.353005, 79.149277), (111.2031, 79.149277), (109.053195, 79.149277), (106.90329, 79.149277), (104.753385, 79.149277), (102.603481, 79.149277), (100.453576, 79.149277), (98.303671, 79.149277), (96.153766, 79.149277), (94.003861, 79.149277), (91.853956, 79.149277), (89.704052, 79.149277), (87.554147, 79.149277), (85.404242, 79.149277), (83.254337, 79.149277), (81.104432, 79.149277), (78.954527, 79.149277), (76.804623, 79.149277)], [(145.601577, 79.149277), (145.601577, 106.452322), (143.451673, 106.452322), (141.301768, 106.452322), (139.151863, 106.452322), (137.001958, 106.452322), (134.852053, 106.452322), (132.702148, 106.452322), (130.552244, 106.452322), (128.402339, 106.452322), (126.252434, 106.452322), (124.102529, 106.452322), (121.952624, 106.452322), (119.802719, 106.452322), (117.652815, 106.452322), (115.50291, 106.452322), (113.353005, 106.452322), (111.2031, 106.452322), (109.053195, 106.452322), (106.90329, 106.452322), (104.753385, 106.452322), (102.603481, 106.452322), (100.453576, 106.452322), (98.303671, 106.452322), (96.153766, 106.452322), (94.003861, 106.452322), (91.853956, 106.452322), (89.704052, 106.452322), (87.554147, 106.452322), (85.404242, 106.452322), (83.254337, 106.452322), (81.104432, 106.452322), (78.954527, 106.452322), (76.804623, 106.452322), (76.804623, 79.149277)], [(159.601578, 120.452323), (159.601578, 122.602227), (159.601578, 124.752132), (159.601578, 126.902037), (159.601578, 129.051942), (159.601578, 131.201847), (159.601578, 133.351752), (159.601578, 135.501656), (159.601578, 137.651561), (159.601578, 139.801466), (159.601578, 141.951371), (159.601578, 144.101276), (159.601578, 146.251181), (159.601578, 148.401085), (159.601578, 150.55099), (159.601578, 152.700895), (159.601578, 154.8508), (159.601578, 157.000705), (159.601578, 159.15061), (159.601578, 161.300515), (159.601578, 163.450419), (159.601578, 165.600324), (159.601578, 167.750229), (159.601578, 169.900134), (159.601578, 172.050039), (159.601578, 174.199944), (159.601578, 176.349848), (159.601578, 178.499753), (159.601578, 180.649658), (159.601578, 182.799563), (159.601578, 184.949468), (159.601578, 187.099373), (159.601578, 189.249277)], [(186.904623, 120.452323), (186.904623, 122.602227), (186.904623, 124.752132), (186.904623, 126.902037), (186.904623, 129.051942), (186.904623, 131.201847), (186.904623, 133.351752), (186.904623, 135.501656), (186.904623, 137.651561), (186.904623, 139.801466), (186.904623, 141.951371), (186.904623, 144.101276), (186.904623, 146.251181), (186.904623, 148.401085), (186.904623, 150.55099), (186.904623, 152.700895), (186.904623, 154.8508), (186.904623, 157.000705), (186.904623, 159.15061), (186.904623, 161.300515), (186.904623, 163.450419), (186.904623, 165.600324), (186.904623, 167.750229), (186.904623, 169.900134), (186.904623, 172.050039), (186.904623, 174.199944), (186.904623, 176.349848), (186.904623, 178.499753), (186.904623, 180.649658), (186.904623, 182.799563), (186.904623, 184.949468), (186.904623, 187.099373), (186.904623, 189.249277)], [(186.904623, 120.452323), (159.601578, 120.452323)], [(186.904623, 189.249277), (159.601578, 189.249277)]])\nVISIBLE_CIRCLES = [(111.2031, 154.8508, 34.398477), (111.2031, 154.8508, 12.182794)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(123.386, 106.4523, 123.386, 79.1492), (99.0204, 79.1492, 99.0204, 106.4523), (186.9047, 167.0336, 159.6016, 167.0336), (186.9047, 142.668, 159.6016, 142.668)]\nDIMENSIONS = [('diameter', '%%c100', (111.2031, 154.8508), 34.3985, 45), ('diameter', '%%c35.4167', (111.2031, 154.8508), 12.1828, 135), ('horizontal', '39.6864', (159.6016, 154.8508), (186.9047, 154.8508), (173.2532, 165.8508))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0014_00148034_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0026_00269050","images":["images/0026_00269050.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 66.67 mm. It is extruded to a thickness of 65.31 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5813232514177693\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(134.471363, 76.483062), (132.654727, 76.483062), (130.838092, 76.483062), (129.021457, 76.483062), (127.204822, 76.483062), (125.388187, 76.483062), (123.571552, 76.483062), (121.754916, 76.483062), (119.938281, 76.483062), (118.121646, 76.483062), (116.305011, 76.483062), (114.488376, 76.483062), (112.671741, 76.483062), (110.855105, 76.483062), (109.03847, 76.483062), (107.221835, 76.483062), (105.4052, 76.483062), (103.588565, 76.483062), (101.77193, 76.483062), (99.955295, 76.483062), (98.138659, 76.483062), (96.322024, 76.483062), (94.505389, 76.483062), (92.688754, 76.483062), (90.872119, 76.483062), (89.055484, 76.483062), (87.238848, 76.483062), (85.422213, 76.483062), (83.605578, 76.483062), (81.788943, 76.483062), (79.972308, 76.483062), (78.155673, 76.483062), (76.339037, 76.483062)], [(134.471363, 76.483062), (134.471363, 114.450737), (132.654727, 114.450737), (130.838092, 114.450737), (129.021457, 114.450737), (127.204822, 114.450737), (125.388187, 114.450737), (123.571552, 114.450737), (121.754916, 114.450737), (119.938281, 114.450737), (118.121646, 114.450737), (116.305011, 114.450737), (114.488376, 114.450737), (112.671741, 114.450737), (110.855105, 114.450737), (109.03847, 114.450737), (107.221835, 114.450737), (105.4052, 114.450737), (103.588565, 114.450737), (101.77193, 114.450737), (99.955295, 114.450737), (98.138659, 114.450737), (96.322024, 114.450737), (94.505389, 114.450737), (92.688754, 114.450737), (90.872119, 114.450737), (89.055484, 114.450737), (87.238848, 114.450737), (85.422213, 114.450737), (83.605578, 114.450737), (81.788943, 114.450737), (79.972308, 114.450737), (78.155673, 114.450737), (76.339037, 114.450737), (76.339037, 76.483062)], [(148.471363, 128.450737), (148.471363, 130.267373), (148.471363, 132.084008), (148.471363, 133.900643), (148.471363, 135.717278), (148.471363, 137.533913), (148.471363, 139.350548), (148.471363, 141.167184), (148.471363, 142.983819), (148.471363, 144.800454), (148.471363, 146.617089), (148.471363, 148.433724), (148.471363, 150.250359), (148.471363, 152.066995), (148.471363, 153.88363), (148.471363, 155.700265), (148.471363, 157.5169), (148.471363, 159.333535), (148.471363, 161.15017), (148.471363, 162.966805), (148.471363, 164.783441), (148.471363, 166.600076), (148.471363, 168.416711), (148.471363, 170.233346), (148.471363, 172.049981), (148.471363, 173.866616), (148.471363, 175.683252), (148.471363, 177.499887), (148.471363, 179.316522), (148.471363, 181.133157), (148.471363, 182.949792), (148.471363, 184.766427), (148.471363, 186.583063)], [(186.439038, 128.450737), (186.439038, 130.267373), (186.439038, 132.084008), (186.439038, 133.900643), (186.439038, 135.717278), (186.439038, 137.533913), (186.439038, 139.350548), (186.439038, 141.167184), (186.439038, 142.983819), (186.439038, 144.800454), (186.439038, 146.617089), (186.439038, 148.433724), (186.439038, 150.250359), (186.439038, 152.066995), (186.439038, 153.88363), (186.439038, 155.700265), (186.439038, 157.5169), (186.439038, 159.333535), (186.439038, 161.15017), (186.439038, 162.966805), (186.439038, 164.783441), (186.439038, 166.600076), (186.439038, 168.416711), (186.439038, 170.233346), (186.439038, 172.049981), (186.439038, 173.866616), (186.439038, 175.683252), (186.439038, 177.499887), (186.439038, 179.316522), (186.439038, 181.133157), (186.439038, 182.949792), (186.439038, 184.766427), (186.439038, 186.583063)], [(186.439038, 128.450737), (148.471363, 128.450737)], [(186.439038, 186.583063), (148.471363, 186.583063)]])\nVISIBLE_CIRCLES = [(105.4052, 157.5169, 29.066163), (105.4052, 157.5169, 19.377442)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(124.7827, 114.4508, 124.7827, 76.4831), (86.0278, 76.4831, 86.0278, 114.4508), (186.4391, 176.8944, 148.4714, 176.8944), (186.4391, 138.1395, 148.4714, 138.1395)]\nDIMENSIONS = [('diameter', '%%c100', (105.4052, 157.5169), 29.0662, 45), ('diameter', '%%c66.6667', (105.4052, 157.5169), 19.3775, 135), ('horizontal', '65.3125', (148.4714, 157.5169), (186.4391, 157.5169), (167.4553, 168.5169))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0026_00269050_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0027_00275490","images":["images/0027_00275490.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 4.17 mm. It is extruded to a thickness of 4.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9229445602334296\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(168.726928, 85.023628), (165.842726, 85.023628), (162.958525, 85.023628), (160.074323, 85.023628), (157.190121, 85.023628), (154.305919, 85.023628), (151.421718, 85.023628), (148.537516, 85.023628), (145.653314, 85.023628), (142.769112, 85.023628), (139.884911, 85.023628), (137.000709, 85.023628), (134.116507, 85.023628), (131.232305, 85.023628), (128.348104, 85.023628), (125.463902, 85.023628), (122.5797, 85.023628), (119.695498, 85.023628), (116.811296, 85.023628), (113.927095, 85.023628), (111.042893, 85.023628), (108.158691, 85.023628), (105.274489, 85.023628), (102.390288, 85.023628), (99.506086, 85.023628), (96.621884, 85.023628), (93.737682, 85.023628), (90.853481, 85.023628), (87.969279, 85.023628), (85.085077, 85.023628), (82.200875, 85.023628), (79.316674, 85.023628), (76.432472, 85.023628)], [(168.726928, 85.023628), (168.726928, 88.829172), (165.842726, 88.829172), (162.958525, 88.829172), (160.074323, 88.829172), (157.190121, 88.829172), (154.305919, 88.829172), (151.421718, 88.829172), (148.537516, 88.829172), (145.653314, 88.829172), (142.769112, 88.829172), (139.884911, 88.829172), (137.000709, 88.829172), (134.116507, 88.829172), (131.232305, 88.829172), (128.348104, 88.829172), (125.463902, 88.829172), (122.5797, 88.829172), (119.695498, 88.829172), (116.811296, 88.829172), (113.927095, 88.829172), (111.042893, 88.829172), (108.158691, 88.829172), (105.274489, 88.829172), (102.390288, 88.829172), (99.506086, 88.829172), (96.621884, 88.829172), (93.737682, 88.829172), (90.853481, 88.829172), (87.969279, 88.829172), (85.085077, 88.829172), (82.200875, 88.829172), (79.316674, 88.829172), (76.432472, 88.829172), (76.432472, 85.023628)], [(182.726928, 102.829172), (182.726928, 105.713374), (182.726928, 108.597575), (182.726928, 111.481777), (182.726928, 114.365979), (182.726928, 117.250181), (182.726928, 120.134382), (182.726928, 123.018584), (182.726928, 125.902786), (182.726928, 128.786988), (182.726928, 131.671189), (182.726928, 134.555391), (182.726928, 137.439593), (182.726928, 140.323795), (182.726928, 143.207996), (182.726928, 146.092198), (182.726928, 148.9764), (182.726928, 151.860602), (182.726928, 154.744804), (182.726928, 157.629005), (182.726928, 160.513207), (182.726928, 163.397409), (182.726928, 166.281611), (182.726928, 169.165812), (182.726928, 172.050014), (182.726928, 174.934216), (182.726928, 177.818418), (182.726928, 180.702619), (182.726928, 183.586821), (182.726928, 186.471023), (182.726928, 189.355225), (182.726928, 192.239426), (182.726928, 195.123628)], [(186.532472, 102.829172), (186.532472, 105.713374), (186.532472, 108.597575), (186.532472, 111.481777), (186.532472, 114.365979), (186.532472, 117.250181), (186.532472, 120.134382), (186.532472, 123.018584), (186.532472, 125.902786), (186.532472, 128.786988), (186.532472, 131.671189), (186.532472, 134.555391), (186.532472, 137.439593), (186.532472, 140.323795), (186.532472, 143.207996), (186.532472, 146.092198), (186.532472, 148.9764), (186.532472, 151.860602), (186.532472, 154.744804), (186.532472, 157.629005), (186.532472, 160.513207), (186.532472, 163.397409), (186.532472, 166.281611), (186.532472, 169.165812), (186.532472, 172.050014), (186.532472, 174.934216), (186.532472, 177.818418), (186.532472, 180.702619), (186.532472, 183.586821), (186.532472, 186.471023), (186.532472, 189.355225), (186.532472, 192.239426), (186.532472, 195.123628)], [(186.532472, 102.829172), (182.726928, 102.829172)], [(186.532472, 195.123628), (182.726928, 195.123628)]])\nVISIBLE_CIRCLES = [(122.5797, 148.9764, 46.147228), (122.5797, 148.9764, 1.922801)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(124.5025, 88.8292, 124.5025, 85.0236), (120.6569, 85.0236, 120.6569, 88.8292), (186.5325, 150.8992, 182.7269, 150.8992), (186.5325, 147.0536, 182.7269, 147.0536)]\nDIMENSIONS = [('diameter', '%%c100', (122.5797, 148.9764), 46.1472, 45), ('diameter', '%%c4.1667', (122.5797, 148.9764), 1.9228, 135), ('horizontal', '4.1233', (182.7269, 148.9764), (186.5325, 148.9764), (184.6297, 159.9764))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0027_00275490_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0036_00363395","images":["images/0036_00363395.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 34.04 mm. It is extruded to a thickness of 33.69 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7188381962864794\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(76.40559, 104.13709), (78.65196, 104.13709), (80.898329, 104.13709), (83.144698, 104.13709), (85.391068, 104.13709), (87.637437, 104.13709), (89.883806, 104.13709), (92.130176, 104.13709), (94.376545, 104.13709), (96.622914, 104.13709), (98.869284, 104.13709), (101.115653, 104.13709), (103.362023, 104.13709), (105.608392, 104.13709), (107.854761, 104.13709), (110.101131, 104.13709), (112.3475, 104.13709), (114.593869, 104.13709), (116.840239, 104.13709), (119.086608, 104.13709), (121.332977, 104.13709), (123.579347, 104.13709), (125.825716, 104.13709), (128.072086, 104.13709), (130.318455, 104.13709), (132.564824, 104.13709), (134.811194, 104.13709), (137.057563, 104.13709), (139.303932, 104.13709), (141.550302, 104.13709), (143.796671, 104.13709), (146.04304, 104.13709), (148.28941, 104.13709), (148.28941, 79.92091)], [(76.40559, 79.92091), (78.65196, 79.92091), (80.898329, 79.92091), (83.144698, 79.92091), (85.391068, 79.92091), (87.637437, 79.92091), (89.883806, 79.92091), (92.130176, 79.92091), (94.376545, 79.92091), (96.622914, 79.92091), (98.869284, 79.92091), (101.115653, 79.92091), (103.362023, 79.92091), (105.608392, 79.92091), (107.854761, 79.92091), (110.101131, 79.92091), (112.3475, 79.92091), (114.593869, 79.92091), (116.840239, 79.92091), (119.086608, 79.92091), (121.332977, 79.92091), (123.579347, 79.92091), (125.825716, 79.92091), (128.072086, 79.92091), (130.318455, 79.92091), (132.564824, 79.92091), (134.811194, 79.92091), (137.057563, 79.92091), (139.303932, 79.92091), (141.550302, 79.92091), (143.796671, 79.92091), (146.04304, 79.92091), (148.28941, 79.92091)], [(76.40559, 79.92091), (76.40559, 104.13709)], [(186.50559, 190.02091), (186.50559, 187.77454), (186.50559, 185.528171), (186.50559, 183.281802), (186.50559, 181.035432), (186.50559, 178.789063), (186.50559, 176.542694), (186.50559, 174.296324), (186.50559, 172.049955), (186.50559, 169.803586), (186.50559, 167.557216), (186.50559, 165.310847), (186.50559, 163.064477), (186.50559, 160.818108), (186.50559, 158.571739), (186.50559, 156.325369), (186.50559, 154.079), (186.50559, 151.832631), (186.50559, 149.586261), (186.50559, 147.339892), (186.50559, 145.093523), (186.50559, 142.847153), (186.50559, 140.600784), (186.50559, 138.354414), (186.50559, 136.108045), (186.50559, 133.861676), (186.50559, 131.615306), (186.50559, 129.368937), (186.50559, 127.122568), (186.50559, 124.876198), (186.50559, 122.629829), (186.50559, 120.38346), (186.50559, 118.13709)], [(162.28941, 190.02091), (162.28941, 187.77454), (162.28941, 185.528171), (162.28941, 183.281802), (162.28941, 181.035432), (162.28941, 178.789063), (162.28941, 176.542694), (162.28941, 174.296324), (162.28941, 172.049955), (162.28941, 169.803586), (162.28941, 167.557216), (162.28941, 165.310847), (162.28941, 163.064477), (162.28941, 160.818108), (162.28941, 158.571739), (162.28941, 156.325369), (162.28941, 154.079), (162.28941, 151.832631), (162.28941, 149.586261), (162.28941, 147.339892), (162.28941, 145.093523), (162.28941, 142.847153), (162.28941, 140.600784), (162.28941, 138.354414), (162.28941, 136.108045), (162.28941, 133.861676), (162.28941, 131.615306), (162.28941, 129.368937), (162.28941, 127.122568), (162.28941, 124.876198), (162.28941, 122.629829), (162.28941, 120.38346), (162.28941, 118.13709)], [(162.28941, 190.02091), (186.50559, 190.02091)], [(162.28941, 118.13709), (186.50559, 118.13709)]])\nVISIBLE_CIRCLES = [(112.3475, 154.079, 35.94191), (112.3475, 154.079, 12.235544)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(124.5831, 79.921, 124.5831, 104.1371), (100.112, 104.1371, 100.112, 79.921), (162.2895, 141.8435, 186.5056, 141.8435), (162.2895, 166.3146, 186.5056, 166.3146)]\nDIMENSIONS = [('diameter', '%%c100', (112.3475, 154.079), 35.9419, 45), ('diameter', '%%c34.0426', (112.3475, 154.079), 12.2356, 135), ('horizontal', '33.6879', (186.5056, 154.079), (162.2895, 154.079), (174.3976, 143.079))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0036_00363395_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0038_00387345","images":["images/0038_00387345.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 12.5 mm. It is extruded to a thickness of 9.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4805\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(151.4152, 95.634783), (149.913637, 95.634783), (148.412075, 95.634783), (146.910512, 95.634783), (145.40895, 95.634783), (143.907387, 95.634783), (142.405825, 95.634783), (140.904262, 95.634783), (139.4027, 95.634783), (137.901138, 95.634783), (136.399575, 95.634783), (134.898012, 95.634783), (133.39645, 95.634783), (131.894887, 95.634783), (130.393325, 95.634783), (128.891762, 95.634783), (127.3902, 95.634783), (125.888638, 95.634783), (124.387075, 95.634783), (122.885513, 95.634783), (121.38395, 95.634783), (119.882387, 95.634783), (118.380825, 95.634783), (116.879262, 95.634783), (115.3777, 95.634783), (113.876137, 95.634783), (112.374575, 95.634783), (110.873013, 95.634783), (109.37145, 95.634783), (107.869888, 95.634783), (106.368325, 95.634783), (104.866762, 95.634783), (103.3652, 95.634783)], [(151.4152, 95.634783), (151.4152, 100.3402), (149.913637, 100.3402), (148.412075, 100.3402), (146.910512, 100.3402), (145.40895, 100.3402), (143.907387, 100.3402), (142.405825, 100.3402), (140.904262, 100.3402), (139.4027, 100.3402), (137.901138, 100.3402), (136.399575, 100.3402), (134.898012, 100.3402), (133.39645, 100.3402), (131.894887, 100.3402), (130.393325, 100.3402), (128.891762, 100.3402), (127.3902, 100.3402), (125.888638, 100.3402), (124.387075, 100.3402), (122.885513, 100.3402), (121.38395, 100.3402), (119.882387, 100.3402), (118.380825, 100.3402), (116.879262, 100.3402), (115.3777, 100.3402), (113.876137, 100.3402), (112.374575, 100.3402), (110.873013, 100.3402), (109.37145, 100.3402), (107.869888, 100.3402), (106.368325, 100.3402), (104.866762, 100.3402), (103.3652, 100.3402), (103.3652, 95.634783)], [(165.4152, 114.3402), (165.4152, 115.841762), (165.4152, 117.343325), (165.4152, 118.844887), (165.4152, 120.34645), (165.4152, 121.848012), (165.4152, 123.349575), (165.4152, 124.851137), (165.4152, 126.3527), (165.4152, 127.854262), (165.4152, 129.355825), (165.4152, 130.857387), (165.4152, 132.35895), (165.4152, 133.860512), (165.4152, 135.362075), (165.4152, 136.863637), (165.4152, 138.3652), (165.4152, 139.866762), (165.4152, 141.368325), (165.4152, 142.869887), (165.4152, 144.37145), (165.4152, 145.873012), (165.4152, 147.374575), (165.4152, 148.876137), (165.4152, 150.3777), (165.4152, 151.879262), (165.4152, 153.380825), (165.4152, 154.882387), (165.4152, 156.38395), (165.4152, 157.885512), (165.4152, 159.387075), (165.4152, 160.888637), (165.4152, 162.3902)], [(170.120617, 114.3402), (170.120617, 115.841762), (170.120617, 117.343325), (170.120617, 118.844887), (170.120617, 120.34645), (170.120617, 121.848012), (170.120617, 123.349575), (170.120617, 124.851137), (170.120617, 126.3527), (170.120617, 127.854262), (170.120617, 129.355825), (170.120617, 130.857387), (170.120617, 132.35895), (170.120617, 133.860512), (170.120617, 135.362075), (170.120617, 136.863637), (170.120617, 138.3652), (170.120617, 139.866762), (170.120617, 141.368325), (170.120617, 142.869887), (170.120617, 144.37145), (170.120617, 145.873012), (170.120617, 147.374575), (170.120617, 148.876137), (170.120617, 150.3777), (170.120617, 151.879262), (170.120617, 153.380825), (170.120617, 154.882387), (170.120617, 156.38395), (170.120617, 157.885512), (170.120617, 159.387075), (170.120617, 160.888637), (170.120617, 162.3902)], [(170.120617, 114.3402), (165.4152, 114.3402)], [(170.120617, 162.3902), (165.4152, 162.3902)]])\nVISIBLE_CIRCLES = [(127.3902, 138.3652, 24.025), (127.3902, 138.3652, 3.003125)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(130.3934, 100.3402, 130.3934, 95.6348), (124.3871, 95.6348, 124.3871, 100.3402), (170.1207, 141.3683, 165.4153, 141.3683), (170.1207, 135.3621, 165.4153, 135.3621)]\nDIMENSIONS = [('diameter', '%%c100', (127.3902, 138.3652), 24.025, 45), ('diameter', '%%c12.5', (127.3902, 138.3652), 3.0031, 135), ('horizontal', '9.7928', (165.4153, 138.3652), (170.1207, 138.3652), (167.768, 149.3652))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0038_00387345_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0043_00430009","images":["images/0043_00430009.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 87.5 mm. It is extruded to a thickness of 98.96 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4830157068062835\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(125.430885, 74.025385), (123.921461, 74.025385), (122.412037, 74.025385), (120.902613, 74.025385), (119.393189, 74.025385), (117.883765, 74.025385), (116.374341, 74.025385), (114.864917, 74.025385), (113.355493, 74.025385), (111.846069, 74.025385), (110.336645, 74.025385), (108.82722, 74.025385), (107.317796, 74.025385), (105.808372, 74.025385), (104.298948, 74.025385), (102.789524, 74.025385), (101.2801, 74.025385), (99.770676, 74.025385), (98.261252, 74.025385), (96.751828, 74.025385), (95.242404, 74.025385), (93.73298, 74.025385), (92.223555, 74.025385), (90.714131, 74.025385), (89.204707, 74.025385), (87.695283, 74.025385), (86.185859, 74.025385), (84.676435, 74.025385), (83.167011, 74.025385), (81.657587, 74.025385), (80.148163, 74.025385), (78.638739, 74.025385), (77.129315, 74.025385)], [(125.430885, 74.025385), (125.430885, 121.823814), (123.921461, 121.823814), (122.412037, 121.823814), (120.902613, 121.823814), (119.393189, 121.823814), (117.883765, 121.823814), (116.374341, 121.823814), (114.864917, 121.823814), (113.355493, 121.823814), (111.846069, 121.823814), (110.336645, 121.823814), (108.82722, 121.823814), (107.317796, 121.823814), (105.808372, 121.823814), (104.298948, 121.823814), (102.789524, 121.823814), (101.2801, 121.823814), (99.770676, 121.823814), (98.261252, 121.823814), (96.751828, 121.823814), (95.242404, 121.823814), (93.73298, 121.823814), (92.223555, 121.823814), (90.714131, 121.823814), (89.204707, 121.823814), (87.695283, 121.823814), (86.185859, 121.823814), (84.676435, 121.823814), (83.167011, 121.823814), (81.657587, 121.823814), (80.148163, 121.823814), (78.638739, 121.823814), (77.129315, 121.823814), (77.129315, 74.025385)], [(139.430886, 135.823815), (139.430886, 137.333239), (139.430886, 138.842663), (139.430886, 140.352087), (139.430886, 141.861511), (139.430886, 143.370935), (139.430886, 144.880359), (139.430886, 146.389783), (139.430886, 147.899207), (139.430886, 149.408631), (139.430886, 150.918055), (139.430886, 152.42748), (139.430886, 153.936904), (139.430886, 155.446328), (139.430886, 156.955752), (139.430886, 158.465176), (139.430886, 159.9746), (139.430886, 161.484024), (139.430886, 162.993448), (139.430886, 164.502872), (139.430886, 166.012296), (139.430886, 167.52172), (139.430886, 169.031145), (139.430886, 170.540569), (139.430886, 172.049993), (139.430886, 173.559417), (139.430886, 175.068841), (139.430886, 176.578265), (139.430886, 178.087689), (139.430886, 179.597113), (139.430886, 181.106537), (139.430886, 182.615961), (139.430886, 184.125385)], [(187.229315, 135.823815), (187.229315, 137.333239), (187.229315, 138.842663), (187.229315, 140.352087), (187.229315, 141.861511), (187.229315, 143.370935), (187.229315, 144.880359), (187.229315, 146.389783), (187.229315, 147.899207), (187.229315, 149.408631), (187.229315, 150.918055), (187.229315, 152.42748), (187.229315, 153.936904), (187.229315, 155.446328), (187.229315, 156.955752), (187.229315, 158.465176), (187.229315, 159.9746), (187.229315, 161.484024), (187.229315, 162.993448), (187.229315, 164.502872), (187.229315, 166.012296), (187.229315, 167.52172), (187.229315, 169.031145), (187.229315, 170.540569), (187.229315, 172.049993), (187.229315, 173.559417), (187.229315, 175.068841), (187.229315, 176.578265), (187.229315, 178.087689), (187.229315, 179.597113), (187.229315, 181.106537), (187.229315, 182.615961), (187.229315, 184.125385)], [(187.229315, 135.823815), (139.430886, 135.823815)], [(187.229315, 184.125385), (139.430886, 184.125385)]])\nVISIBLE_CIRCLES = [(101.2801, 159.9746, 24.150785), (101.2801, 159.9746, 21.131937)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(122.412, 121.8238, 122.412, 74.0254), (80.1482, 74.0254, 80.1482, 121.8238), (187.2293, 181.1065, 139.4309, 181.1065), (187.2293, 138.8427, 139.4309, 138.8427)]\nDIMENSIONS = [('diameter', '%%c100', (101.2801, 159.9746), 24.1508, 45), ('diameter', '%%c87.5', (101.2801, 159.9746), 21.1319, 135), ('horizontal', '98.9583', (139.4309, 159.9746), (187.2293, 159.9746), (163.3301, 170.9746))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0043_00430009_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00483293","images":["images/0048_00483293.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 62.5 mm. It is extruded to a thickness of 95.82 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.49076483998986725\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(127.557842, 74.219142), (126.024202, 74.219142), (124.490562, 74.219142), (122.956922, 74.219142), (121.423281, 74.219142), (119.889641, 74.219142), (118.356001, 74.219142), (116.822361, 74.219142), (115.288721, 74.219142), (113.755081, 74.219142), (112.221441, 74.219142), (110.687801, 74.219142), (109.15416, 74.219142), (107.62052, 74.219142), (106.08688, 74.219142), (104.55324, 74.219142), (103.0196, 74.219142), (101.48596, 74.219142), (99.95232, 74.219142), (98.41868, 74.219142), (96.88504, 74.219142), (95.351399, 74.219142), (93.817759, 74.219142), (92.284119, 74.219142), (90.750479, 74.219142), (89.216839, 74.219142), (87.683199, 74.219142), (86.149559, 74.219142), (84.615919, 74.219142), (83.082278, 74.219142), (81.548638, 74.219142), (80.014998, 74.219142), (78.481358, 74.219142)], [(127.557842, 74.219142), (127.557842, 121.242658), (126.024202, 121.242658), (124.490562, 121.242658), (122.956922, 121.242658), (121.423281, 121.242658), (119.889641, 121.242658), (118.356001, 121.242658), (116.822361, 121.242658), (115.288721, 121.242658), (113.755081, 121.242658), (112.221441, 121.242658), (110.687801, 121.242658), (109.15416, 121.242658), (107.62052, 121.242658), (106.08688, 121.242658), (104.55324, 121.242658), (103.0196, 121.242658), (101.48596, 121.242658), (99.95232, 121.242658), (98.41868, 121.242658), (96.88504, 121.242658), (95.351399, 121.242658), (93.817759, 121.242658), (92.284119, 121.242658), (90.750479, 121.242658), (89.216839, 121.242658), (87.683199, 121.242658), (86.149559, 121.242658), (84.615919, 121.242658), (83.082278, 121.242658), (81.548638, 121.242658), (80.014998, 121.242658), (78.481358, 121.242658), (78.481358, 74.219142)], [(141.557842, 135.242658), (141.557842, 136.776298), (141.557842, 138.309938), (141.557842, 139.843578), (141.557842, 141.377219), (141.557842, 142.910859), (141.557842, 144.444499), (141.557842, 145.978139), (141.557842, 147.511779), (141.557842, 149.045419), (141.557842, 150.579059), (141.557842, 152.112699), (141.557842, 153.64634), (141.557842, 155.17998), (141.557842, 156.71362), (141.557842, 158.24726), (141.557842, 159.7809), (141.557842, 161.31454), (141.557842, 162.84818), (141.557842, 164.38182), (141.557842, 165.91546), (141.557842, 167.449101), (141.557842, 168.982741), (141.557842, 170.516381), (141.557842, 172.050021), (141.557842, 173.583661), (141.557842, 175.117301), (141.557842, 176.650941), (141.557842, 178.184581), (141.557842, 179.718222), (141.557842, 181.251862), (141.557842, 182.785502), (141.557842, 184.319142)], [(188.581358, 135.242658), (188.581358, 136.776298), (188.581358, 138.309938), (188.581358, 139.843578), (188.581358, 141.377219), (188.581358, 142.910859), (188.581358, 144.444499), (188.581358, 145.978139), (188.581358, 147.511779), (188.581358, 149.045419), (188.581358, 150.579059), (188.581358, 152.112699), (188.581358, 153.64634), (188.581358, 155.17998), (188.581358, 156.71362), (188.581358, 158.24726), (188.581358, 159.7809), (188.581358, 161.31454), (188.581358, 162.84818), (188.581358, 164.38182), (188.581358, 165.91546), (188.581358, 167.449101), (188.581358, 168.982741), (188.581358, 170.516381), (188.581358, 172.050021), (188.581358, 173.583661), (188.581358, 175.117301), (188.581358, 176.650941), (188.581358, 178.184581), (188.581358, 179.718222), (188.581358, 181.251862), (188.581358, 182.785502), (188.581358, 184.319142)], [(188.581358, 135.242658), (141.557842, 135.242658)], [(188.581358, 184.319142), (141.557842, 184.319142)]])\nVISIBLE_CIRCLES = [(103.0196, 159.7809, 24.538242), (103.0196, 159.7809, 15.336401)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(118.356, 121.2426, 118.356, 74.2191), (87.6832, 74.2191, 87.6832, 121.2426), (188.5813, 175.1173, 141.5578, 175.1173), (188.5813, 144.4445, 141.5578, 144.4445)]\nDIMENSIONS = [('diameter', '%%c100', (103.0196, 159.7809), 24.5382, 45), ('diameter', '%%c62.5', (103.0196, 159.7809), 15.3364, 135), ('horizontal', '95.8168', (141.5578, 159.7809), (188.5813, 159.7809), (165.0696, 170.7809))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00483293_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0050_00501018","images":["images/0050_00501018.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 70.83 mm. It is extruded to a thickness of 13.92 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8436039434204886\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(154.795897, 83.040097), (152.159635, 83.040097), (149.523373, 83.040097), (146.88711, 83.040097), (144.250848, 83.040097), (141.614586, 83.040097), (138.978323, 83.040097), (136.342061, 83.040097), (133.705799, 83.040097), (131.069536, 83.040097), (128.433274, 83.040097), (125.797012, 83.040097), (123.160749, 83.040097), (120.524487, 83.040097), (117.888225, 83.040097), (115.251962, 83.040097), (112.6157, 83.040097), (109.979438, 83.040097), (107.343175, 83.040097), (104.706913, 83.040097), (102.070651, 83.040097), (99.434388, 83.040097), (96.798126, 83.040097), (94.161864, 83.040097), (91.525601, 83.040097), (88.889339, 83.040097), (86.253077, 83.040097), (83.616814, 83.040097), (80.980552, 83.040097), (78.34429, 83.040097), (75.708027, 83.040097), (73.071765, 83.040097), (70.435503, 83.040097)], [(154.795897, 83.040097), (154.795897, 94.779703), (152.159635, 94.779703), (149.523373, 94.779703), (146.88711, 94.779703), (144.250848, 94.779703), (141.614586, 94.779703), (138.978323, 94.779703), (136.342061, 94.779703), (133.705799, 94.779703), (131.069536, 94.779703), (128.433274, 94.779703), (125.797012, 94.779703), (123.160749, 94.779703), (120.524487, 94.779703), (117.888225, 94.779703), (115.251962, 94.779703), (112.6157, 94.779703), (109.979438, 94.779703), (107.343175, 94.779703), (104.706913, 94.779703), (102.070651, 94.779703), (99.434388, 94.779703), (96.798126, 94.779703), (94.161864, 94.779703), (91.525601, 94.779703), (88.889339, 94.779703), (86.253077, 94.779703), (83.616814, 94.779703), (80.980552, 94.779703), (78.34429, 94.779703), (75.708027, 94.779703), (73.071765, 94.779703), (70.435503, 94.779703), (70.435503, 83.040097)], [(168.795897, 108.779703), (168.795897, 111.415965), (168.795897, 114.052227), (168.795897, 116.68849), (168.795897, 119.324752), (168.795897, 121.961014), (168.795897, 124.597277), (168.795897, 127.233539), (168.795897, 129.869801), (168.795897, 132.506064), (168.795897, 135.142326), (168.795897, 137.778588), (168.795897, 140.414851), (168.795897, 143.051113), (168.795897, 145.687375), (168.795897, 148.323638), (168.795897, 150.9599), (168.795897, 153.596162), (168.795897, 156.232425), (168.795897, 158.868687), (168.795897, 161.504949), (168.795897, 164.141212), (168.795897, 166.777474), (168.795897, 169.413736), (168.795897, 172.049999), (168.795897, 174.686261), (168.795897, 177.322523), (168.795897, 179.958786), (168.795897, 182.595048), (168.795897, 185.23131), (168.795897, 187.867573), (168.795897, 190.503835), (168.795897, 193.140097)], [(180.535503, 108.779703), (180.535503, 111.415965), (180.535503, 114.052227), (180.535503, 116.68849), (180.535503, 119.324752), (180.535503, 121.961014), (180.535503, 124.597277), (180.535503, 127.233539), (180.535503, 129.869801), (180.535503, 132.506064), (180.535503, 135.142326), (180.535503, 137.778588), (180.535503, 140.414851), (180.535503, 143.051113), (180.535503, 145.687375), (180.535503, 148.323638), (180.535503, 150.9599), (180.535503, 153.596162), (180.535503, 156.232425), (180.535503, 158.868687), (180.535503, 161.504949), (180.535503, 164.141212), (180.535503, 166.777474), (180.535503, 169.413736), (180.535503, 172.049999), (180.535503, 174.686261), (180.535503, 177.322523), (180.535503, 179.958786), (180.535503, 182.595048), (180.535503, 185.23131), (180.535503, 187.867573), (180.535503, 190.503835), (180.535503, 193.140097)], [(180.535503, 108.779703), (168.795897, 108.779703)], [(180.535503, 193.140097), (168.795897, 193.140097)]])\nVISIBLE_CIRCLES = [(112.6157, 150.9599, 42.180197), (112.6157, 150.9599, 29.87764)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(142.4934, 94.7797, 142.4934, 83.0401), (82.7381, 83.0401, 82.7381, 94.7797), (180.5355, 180.8375, 168.7959, 180.8375), (180.5355, 121.0823, 168.7959, 121.0823)]\nDIMENSIONS = [('diameter', '%%c100', (112.6157, 150.9599), 42.1802, 45), ('diameter', '%%c70.8333', (112.6157, 150.9599), 29.8776, 135), ('horizontal', '13.916', (168.7959, 150.9599), (180.5355, 150.9599), (174.6657, 161.9599))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0050_00501018_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0055_00550385","images":["images/0055_00550385.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 45.83 mm. It is extruded to a thickness of 7.22 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8963238538609416\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(161.743093, 84.358092), (158.942081, 84.358092), (156.141069, 84.358092), (153.340057, 84.358092), (150.539045, 84.358092), (147.738032, 84.358092), (144.93702, 84.358092), (142.136008, 84.358092), (139.334996, 84.358092), (136.533984, 84.358092), (133.732972, 84.358092), (130.93196, 84.358092), (128.130948, 84.358092), (125.329936, 84.358092), (122.528924, 84.358092), (119.727912, 84.358092), (116.9269, 84.358092), (114.125888, 84.358092), (111.324876, 84.358092), (108.523864, 84.358092), (105.722852, 84.358092), (102.92184, 84.358092), (100.120828, 84.358092), (97.319816, 84.358092), (94.518804, 84.358092), (91.717792, 84.358092), (88.91678, 84.358092), (86.115768, 84.358092), (83.314755, 84.358092), (80.513743, 84.358092), (77.712731, 84.358092), (74.911719, 84.358092), (72.110707, 84.358092)], [(161.743093, 84.358092), (161.743093, 90.825707), (158.942081, 90.825707), (156.141069, 90.825707), (153.340057, 90.825707), (150.539045, 90.825707), (147.738032, 90.825707), (144.93702, 90.825707), (142.136008, 90.825707), (139.334996, 90.825707), (136.533984, 90.825707), (133.732972, 90.825707), (130.93196, 90.825707), (128.130948, 90.825707), (125.329936, 90.825707), (122.528924, 90.825707), (119.727912, 90.825707), (116.9269, 90.825707), (114.125888, 90.825707), (111.324876, 90.825707), (108.523864, 90.825707), (105.722852, 90.825707), (102.92184, 90.825707), (100.120828, 90.825707), (97.319816, 90.825707), (94.518804, 90.825707), (91.717792, 90.825707), (88.91678, 90.825707), (86.115768, 90.825707), (83.314755, 90.825707), (80.513743, 90.825707), (77.712731, 90.825707), (74.911719, 90.825707), (72.110707, 90.825707), (72.110707, 84.358092)], [(175.743093, 104.825707), (175.743093, 107.626719), (175.743093, 110.427731), (175.743093, 113.228743), (175.743093, 116.029755), (175.743093, 118.830768), (175.743093, 121.63178), (175.743093, 124.432792), (175.743093, 127.233804), (175.743093, 130.034816), (175.743093, 132.835828), (175.743093, 135.63684), (175.743093, 138.437852), (175.743093, 141.238864), (175.743093, 144.039876), (175.743093, 146.840888), (175.743093, 149.6419), (175.743093, 152.442912), (175.743093, 155.243924), (175.743093, 158.044936), (175.743093, 160.845948), (175.743093, 163.64696), (175.743093, 166.447972), (175.743093, 169.248984), (175.743093, 172.049996), (175.743093, 174.851008), (175.743093, 177.65202), (175.743093, 180.453032), (175.743093, 183.254045), (175.743093, 186.055057), (175.743093, 188.856069), (175.743093, 191.657081), (175.743093, 194.458093)], [(182.210708, 104.825707), (182.210708, 107.626719), (182.210708, 110.427731), (182.210708, 113.228743), (182.210708, 116.029755), (182.210708, 118.830768), (182.210708, 121.63178), (182.210708, 124.432792), (182.210708, 127.233804), (182.210708, 130.034816), (182.210708, 132.835828), (182.210708, 135.63684), (182.210708, 138.437852), (182.210708, 141.238864), (182.210708, 144.039876), (182.210708, 146.840888), (182.210708, 149.6419), (182.210708, 152.442912), (182.210708, 155.243924), (182.210708, 158.044936), (182.210708, 160.845948), (182.210708, 163.64696), (182.210708, 166.447972), (182.210708, 169.248984), (182.210708, 172.049996), (182.210708, 174.851008), (182.210708, 177.65202), (182.210708, 180.453032), (182.210708, 183.254045), (182.210708, 186.055057), (182.210708, 188.856069), (182.210708, 191.657081), (182.210708, 194.458093)], [(182.210708, 104.825707), (175.743093, 104.825707)], [(182.210708, 194.458093), (175.743093, 194.458093)]])\nVISIBLE_CIRCLES = [(116.9269, 149.6419, 44.816193), (116.9269, 149.6419, 20.540755)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(137.4677, 90.8257, 137.4677, 84.3581), (96.3862, 84.3581, 96.3862, 90.8257), (182.2108, 170.1827, 175.7431, 170.1827), (182.2108, 129.1011, 175.7431, 129.1011)]\nDIMENSIONS = [('diameter', '%%c100', (116.9269, 149.6419), 44.8162, 45), ('diameter', '%%c45.8333', (116.9269, 149.6419), 20.5407, 135), ('horizontal', '7.2157', (175.7431, 149.6419), (182.2108, 149.6419), (178.977, 160.6419))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0055_00550385_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0061_00616816","images":["images/0061_00616816.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 60.42 mm. It is extruded to a thickness of 16.49 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8249418777943337\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(154.402394, 82.573594), (151.824451, 82.573594), (149.246507, 82.573594), (146.668564, 82.573594), (144.09062, 82.573594), (141.512677, 82.573594), (138.934734, 82.573594), (136.35679, 82.573594), (133.778847, 82.573594), (131.200904, 82.573594), (128.62296, 82.573594), (126.045017, 82.573594), (123.467073, 82.573594), (120.88913, 82.573594), (118.311187, 82.573594), (115.733243, 82.573594), (113.1553, 82.573594), (110.577357, 82.573594), (107.999413, 82.573594), (105.42147, 82.573594), (102.843527, 82.573594), (100.265583, 82.573594), (97.68764, 82.573594), (95.109696, 82.573594), (92.531753, 82.573594), (89.95381, 82.573594), (87.375866, 82.573594), (84.797923, 82.573594), (82.21998, 82.573594), (79.642036, 82.573594), (77.064093, 82.573594), (74.486149, 82.573594), (71.908206, 82.573594)], [(154.402394, 82.573594), (154.402394, 96.179406), (151.824451, 96.179406), (149.246507, 96.179406), (146.668564, 96.179406), (144.09062, 96.179406), (141.512677, 96.179406), (138.934734, 96.179406), (136.35679, 96.179406), (133.778847, 96.179406), (131.200904, 96.179406), (128.62296, 96.179406), (126.045017, 96.179406), (123.467073, 96.179406), (120.88913, 96.179406), (118.311187, 96.179406), (115.733243, 96.179406), (113.1553, 96.179406), (110.577357, 96.179406), (107.999413, 96.179406), (105.42147, 96.179406), (102.843527, 96.179406), (100.265583, 96.179406), (97.68764, 96.179406), (95.109696, 96.179406), (92.531753, 96.179406), (89.95381, 96.179406), (87.375866, 96.179406), (84.797923, 96.179406), (82.21998, 96.179406), (79.642036, 96.179406), (77.064093, 96.179406), (74.486149, 96.179406), (71.908206, 96.179406), (71.908206, 82.573594)], [(168.402394, 110.179406), (168.402394, 112.757349), (168.402394, 115.335293), (168.402394, 117.913236), (168.402394, 120.49118), (168.402394, 123.069123), (168.402394, 125.647066), (168.402394, 128.22501), (168.402394, 130.802953), (168.402394, 133.380896), (168.402394, 135.95884), (168.402394, 138.536783), (168.402394, 141.114727), (168.402394, 143.69267), (168.402394, 146.270613), (168.402394, 148.848557), (168.402394, 151.4265), (168.402394, 154.004443), (168.402394, 156.582387), (168.402394, 159.16033), (168.402394, 161.738273), (168.402394, 164.316217), (168.402394, 166.89416), (168.402394, 169.472104), (168.402394, 172.050047), (168.402394, 174.62799), (168.402394, 177.205934), (168.402394, 179.783877), (168.402394, 182.36182), (168.402394, 184.939764), (168.402394, 187.517707), (168.402394, 190.095651), (168.402394, 192.673594)], [(182.008206, 110.179406), (182.008206, 112.757349), (182.008206, 115.335293), (182.008206, 117.913236), (182.008206, 120.49118), (182.008206, 123.069123), (182.008206, 125.647066), (182.008206, 128.22501), (182.008206, 130.802953), (182.008206, 133.380896), (182.008206, 135.95884), (182.008206, 138.536783), (182.008206, 141.114727), (182.008206, 143.69267), (182.008206, 146.270613), (182.008206, 148.848557), (182.008206, 151.4265), (182.008206, 154.004443), (182.008206, 156.582387), (182.008206, 159.16033), (182.008206, 161.738273), (182.008206, 164.316217), (182.008206, 166.89416), (182.008206, 169.472104), (182.008206, 172.050047), (182.008206, 174.62799), (182.008206, 177.205934), (182.008206, 179.783877), (182.008206, 182.36182), (182.008206, 184.939764), (182.008206, 187.517707), (182.008206, 190.095651), (182.008206, 192.673594)], [(182.008206, 110.179406), (168.402394, 110.179406)], [(182.008206, 192.673594), (168.402394, 192.673594)]])\nVISIBLE_CIRCLES = [(113.1553, 151.4265, 41.247094), (113.1553, 151.4265, 24.920119)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(138.0754, 96.1794, 138.0754, 82.5735), (88.2352, 82.5735, 88.2352, 96.1794), (182.0082, 176.3466, 168.4024, 176.3466), (182.0082, 126.5063, 168.4024, 126.5063)]\nDIMENSIONS = [('diameter', '%%c100', (113.1553, 151.4265), 41.2471, 45), ('diameter', '%%c60.4167', (113.1553, 151.4265), 24.9201, 135), ('horizontal', '16.4931', (168.4024, 151.4265), (182.0082, 151.4265), (175.2053, 162.4265))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0061_00616816_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0064_00647766","images":["images/0064_00647766.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 52.08 mm. It is extruded to a thickness of 59.38 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6029803921568627\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(137.28512, 77.024519), (135.400806, 77.024519), (133.516492, 77.024519), (131.632178, 77.024519), (129.747865, 77.024519), (127.863551, 77.024519), (125.979237, 77.024519), (124.094924, 77.024519), (122.21061, 77.024519), (120.326296, 77.024519), (118.441982, 77.024519), (116.557669, 77.024519), (114.673355, 77.024519), (112.789041, 77.024519), (110.904727, 77.024519), (109.020414, 77.024519), (107.1361, 77.024519), (105.251786, 77.024519), (103.367473, 77.024519), (101.483159, 77.024519), (99.598845, 77.024519), (97.714531, 77.024519), (95.830218, 77.024519), (93.945904, 77.024519), (92.06159, 77.024519), (90.177276, 77.024519), (88.292963, 77.024519), (86.408649, 77.024519), (84.524335, 77.024519), (82.640022, 77.024519), (80.755708, 77.024519), (78.871394, 77.024519), (76.98708, 77.024519)], [(137.28512, 77.024519), (137.28512, 112.82648), (135.400806, 112.82648), (133.516492, 112.82648), (131.632178, 112.82648), (129.747865, 112.82648), (127.863551, 112.82648), (125.979237, 112.82648), (124.094924, 112.82648), (122.21061, 112.82648), (120.326296, 112.82648), (118.441982, 112.82648), (116.557669, 112.82648), (114.673355, 112.82648), (112.789041, 112.82648), (110.904727, 112.82648), (109.020414, 112.82648), (107.1361, 112.82648), (105.251786, 112.82648), (103.367473, 112.82648), (101.483159, 112.82648), (99.598845, 112.82648), (97.714531, 112.82648), (95.830218, 112.82648), (93.945904, 112.82648), (92.06159, 112.82648), (90.177276, 112.82648), (88.292963, 112.82648), (86.408649, 112.82648), (84.524335, 112.82648), (82.640022, 112.82648), (80.755708, 112.82648), (78.871394, 112.82648), (76.98708, 112.82648), (76.98708, 77.024519)], [(151.28512, 126.82648), (151.28512, 128.710794), (151.28512, 130.595108), (151.28512, 132.479422), (151.28512, 134.363735), (151.28512, 136.248049), (151.28512, 138.132363), (151.28512, 140.016676), (151.28512, 141.90099), (151.28512, 143.785304), (151.28512, 145.669618), (151.28512, 147.553931), (151.28512, 149.438245), (151.28512, 151.322559), (151.28512, 153.206873), (151.28512, 155.091186), (151.28512, 156.9755), (151.28512, 158.859814), (151.28512, 160.744127), (151.28512, 162.628441), (151.28512, 164.512755), (151.28512, 166.397069), (151.28512, 168.281382), (151.28512, 170.165696), (151.28512, 172.05001), (151.28512, 173.934324), (151.28512, 175.818637), (151.28512, 177.702951), (151.28512, 179.587265), (151.28512, 181.471578), (151.28512, 183.355892), (151.28512, 185.240206), (151.28512, 187.12452)], [(187.087081, 126.82648), (187.087081, 128.710794), (187.087081, 130.595108), (187.087081, 132.479422), (187.087081, 134.363735), (187.087081, 136.248049), (187.087081, 138.132363), (187.087081, 140.016676), (187.087081, 141.90099), (187.087081, 143.785304), (187.087081, 145.669618), (187.087081, 147.553931), (187.087081, 149.438245), (187.087081, 151.322559), (187.087081, 153.206873), (187.087081, 155.091186), (187.087081, 156.9755), (187.087081, 158.859814), (187.087081, 160.744127), (187.087081, 162.628441), (187.087081, 164.512755), (187.087081, 166.397069), (187.087081, 168.281382), (187.087081, 170.165696), (187.087081, 172.05001), (187.087081, 173.934324), (187.087081, 175.818637), (187.087081, 177.702951), (187.087081, 179.587265), (187.087081, 181.471578), (187.087081, 183.355892), (187.087081, 185.240206), (187.087081, 187.12452)], [(187.087081, 126.82648), (151.28512, 126.82648)], [(187.087081, 187.12452), (151.28512, 187.12452)]])\nVISIBLE_CIRCLES = [(107.1361, 156.9755, 30.14902), (107.1361, 156.9755, 15.702614)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(122.8387, 112.8265, 122.8387, 77.0245), (91.4335, 77.0245, 91.4335, 112.8265), (187.0871, 172.6781, 151.2851, 172.6781), (187.0871, 141.2729, 151.2851, 141.2729)]\nDIMENSIONS = [('diameter', '%%c100', (107.1361, 156.9755), 30.149, 45), ('diameter', '%%c52.0833', (107.1361, 156.9755), 15.7026, 135), ('horizontal', '59.375', (151.2851, 156.9755), (187.0871, 156.9755), (169.1861, 167.9755))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0064_00647766_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0064_00649652","images":["images/0064_00649652.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 72.92 mm. It is extruded to a thickness of 9.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(157.059573, 83.832173), (154.324306, 83.832173), (151.589039, 83.832173), (148.853772, 83.832173), (146.118505, 83.832173), (143.383238, 83.832173), (140.647971, 83.832173), (137.912704, 83.832173), (135.177437, 83.832173), (132.44217, 83.832173), (129.706903, 83.832173), (126.971635, 83.832173), (124.236368, 83.832173), (121.501101, 83.832173), (118.765834, 83.832173), (116.030567, 83.832173), (113.2953, 83.832173), (110.560033, 83.832173), (107.824766, 83.832173), (105.089499, 83.832173), (102.354232, 83.832173), (99.618965, 83.832173), (96.883697, 83.832173), (94.14843, 83.832173), (91.413163, 83.832173), (88.677896, 83.832173), (85.942629, 83.832173), (83.207362, 83.832173), (80.472095, 83.832173), (77.736828, 83.832173), (75.001561, 83.832173), (72.266294, 83.832173), (69.531027, 83.832173)], [(157.059573, 83.832173), (157.059573, 92.403626), (154.324306, 92.403626), (151.589039, 92.403626), (148.853772, 92.403626), (146.118505, 92.403626), (143.383238, 92.403626), (140.647971, 92.403626), (137.912704, 92.403626), (135.177437, 92.403626), (132.44217, 92.403626), (129.706903, 92.403626), (126.971635, 92.403626), (124.236368, 92.403626), (121.501101, 92.403626), (118.765834, 92.403626), (116.030567, 92.403626), (113.2953, 92.403626), (110.560033, 92.403626), (107.824766, 92.403626), (105.089499, 92.403626), (102.354232, 92.403626), (99.618965, 92.403626), (96.883697, 92.403626), (94.14843, 92.403626), (91.413163, 92.403626), (88.677896, 92.403626), (85.942629, 92.403626), (83.207362, 92.403626), (80.472095, 92.403626), (77.736828, 92.403626), (75.001561, 92.403626), (72.266294, 92.403626), (69.531027, 92.403626), (69.531027, 83.832173)], [(171.059574, 106.403627), (171.059574, 109.138894), (171.059574, 111.874161), (171.059574, 114.609428), (171.059574, 117.344695), (171.059574, 120.079962), (171.059574, 122.815229), (171.059574, 125.550496), (171.059574, 128.285763), (171.059574, 131.02103), (171.059574, 133.756297), (171.059574, 136.491565), (171.059574, 139.226832), (171.059574, 141.962099), (171.059574, 144.697366), (171.059574, 147.432633), (171.059574, 150.1679), (171.059574, 152.903167), (171.059574, 155.638434), (171.059574, 158.373701), (171.059574, 161.108968), (171.059574, 163.844235), (171.059574, 166.579503), (171.059574, 169.31477), (171.059574, 172.050037), (171.059574, 174.785304), (171.059574, 177.520571), (171.059574, 180.255838), (171.059574, 182.991105), (171.059574, 185.726372), (171.059574, 188.461639), (171.059574, 191.196906), (171.059574, 193.932173)], [(179.631027, 106.403627), (179.631027, 109.138894), (179.631027, 111.874161), (179.631027, 114.609428), (179.631027, 117.344695), (179.631027, 120.079962), (179.631027, 122.815229), (179.631027, 125.550496), (179.631027, 128.285763), (179.631027, 131.02103), (179.631027, 133.756297), (179.631027, 136.491565), (179.631027, 139.226832), (179.631027, 141.962099), (179.631027, 144.697366), (179.631027, 147.432633), (179.631027, 150.1679), (179.631027, 152.903167), (179.631027, 155.638434), (179.631027, 158.373701), (179.631027, 161.108968), (179.631027, 163.844235), (179.631027, 166.579503), (179.631027, 169.31477), (179.631027, 172.050037), (179.631027, 174.785304), (179.631027, 177.520571), (179.631027, 180.255838), (179.631027, 182.991105), (179.631027, 185.726372), (179.631027, 188.461639), (179.631027, 191.196906), (179.631027, 193.932173)], [(179.631027, 106.403627), (171.059574, 106.403627)], [(179.631027, 193.932173), (171.059574, 193.932173)]])\nVISIBLE_CIRCLES = [(113.2953, 150.1679, 43.764273), (113.2953, 150.1679, 31.911449)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(145.2068, 92.4036, 145.2068, 83.8321), (81.3839, 83.8321, 81.3839, 92.4036), (179.6311, 182.0793, 171.0596, 182.0793), (179.6311, 118.2564, 171.0596, 118.2564)]\nDIMENSIONS = [('diameter', '%%c100', (113.2953, 150.1679), 43.7643, 45), ('diameter', '%%c72.9167', (113.2953, 150.1679), 31.9115, 135), ('horizontal', '9.7928', (171.0596, 150.1679), (179.6311, 150.1679), (175.3454, 161.1679))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0064_00649652_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0065_00655113","images":["images/0065_00655113.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 54.17 mm. It is extruded to a thickness of 4.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9229445602334296\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.958528, 85.023628), (160.074326, 85.023628), (157.190125, 85.023628), (154.305923, 85.023628), (151.421721, 85.023628), (148.537519, 85.023628), (145.653318, 85.023628), (142.769116, 85.023628), (139.884914, 85.023628), (137.000712, 85.023628), (134.116511, 85.023628), (131.232309, 85.023628), (128.348107, 85.023628), (125.463905, 85.023628), (122.579704, 85.023628), (119.695502, 85.023628), (116.8113, 85.023628), (113.927098, 85.023628), (111.042896, 85.023628), (108.158695, 85.023628), (105.274493, 85.023628), (102.390291, 85.023628), (99.506089, 85.023628), (96.621888, 85.023628), (93.737686, 85.023628), (90.853484, 85.023628), (87.969282, 85.023628), (85.085081, 85.023628), (82.200879, 85.023628), (79.316677, 85.023628), (76.432475, 85.023628), (73.548274, 85.023628), (70.664072, 85.023628)], [(162.958528, 85.023628), (162.958528, 88.829172), (160.074326, 88.829172), (157.190125, 88.829172), (154.305923, 88.829172), (151.421721, 88.829172), (148.537519, 88.829172), (145.653318, 88.829172), (142.769116, 88.829172), (139.884914, 88.829172), (137.000712, 88.829172), (134.116511, 88.829172), (131.232309, 88.829172), (128.348107, 88.829172), (125.463905, 88.829172), (122.579704, 88.829172), (119.695502, 88.829172), (116.8113, 88.829172), (113.927098, 88.829172), (111.042896, 88.829172), (108.158695, 88.829172), (105.274493, 88.829172), (102.390291, 88.829172), (99.506089, 88.829172), (96.621888, 88.829172), (93.737686, 88.829172), (90.853484, 88.829172), (87.969282, 88.829172), (85.085081, 88.829172), (82.200879, 88.829172), (79.316677, 88.829172), (76.432475, 88.829172), (73.548274, 88.829172), (70.664072, 88.829172), (70.664072, 85.023628)], [(176.958528, 102.829172), (176.958528, 105.713374), (176.958528, 108.597575), (176.958528, 111.481777), (176.958528, 114.365979), (176.958528, 117.250181), (176.958528, 120.134382), (176.958528, 123.018584), (176.958528, 125.902786), (176.958528, 128.786988), (176.958528, 131.671189), (176.958528, 134.555391), (176.958528, 137.439593), (176.958528, 140.323795), (176.958528, 143.207996), (176.958528, 146.092198), (176.958528, 148.9764), (176.958528, 151.860602), (176.958528, 154.744804), (176.958528, 157.629005), (176.958528, 160.513207), (176.958528, 163.397409), (176.958528, 166.281611), (176.958528, 169.165812), (176.958528, 172.050014), (176.958528, 174.934216), (176.958528, 177.818418), (176.958528, 180.702619), (176.958528, 183.586821), (176.958528, 186.471023), (176.958528, 189.355225), (176.958528, 192.239426), (176.958528, 195.123628)], [(180.764072, 102.829172), (180.764072, 105.713374), (180.764072, 108.597575), (180.764072, 111.481777), (180.764072, 114.365979), (180.764072, 117.250181), (180.764072, 120.134382), (180.764072, 123.018584), (180.764072, 125.902786), (180.764072, 128.786988), (180.764072, 131.671189), (180.764072, 134.555391), (180.764072, 137.439593), (180.764072, 140.323795), (180.764072, 143.207996), (180.764072, 146.092198), (180.764072, 148.9764), (180.764072, 151.860602), (180.764072, 154.744804), (180.764072, 157.629005), (180.764072, 160.513207), (180.764072, 163.397409), (180.764072, 166.281611), (180.764072, 169.165812), (180.764072, 172.050014), (180.764072, 174.934216), (180.764072, 177.818418), (180.764072, 180.702619), (180.764072, 183.586821), (180.764072, 186.471023), (180.764072, 189.355225), (180.764072, 192.239426), (180.764072, 195.123628)], [(180.764072, 102.829172), (176.958528, 102.829172)], [(180.764072, 195.123628), (176.958528, 195.123628)]])\nVISIBLE_CIRCLES = [(116.8113, 148.9764, 46.147228), (116.8113, 148.9764, 24.996415)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(141.8077, 88.8292, 141.8077, 85.0236), (91.8149, 85.0236, 91.8149, 88.8292), (180.7641, 173.9728, 176.9585, 173.9728), (180.7641, 123.98, 176.9585, 123.98)]\nDIMENSIONS = [('diameter', '%%c100', (116.8113, 148.9764), 46.1472, 45), ('diameter', '%%c54.1667', (116.8113, 148.9764), 24.9964, 135), ('horizontal', '4.1233', (176.9585, 148.9764), (180.7641, 148.9764), (178.8613, 159.9764))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0065_00655113_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00665653","images":["images/0066_00665653.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 75 mm. It is extruded to a thickness of 34.53 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7143264104529008\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(72.824079, 104.475479), (75.05635, 104.475479), (77.28862, 104.475479), (79.52089, 104.475479), (81.75316, 104.475479), (83.98543, 104.475479), (86.2177, 104.475479), (88.44997, 104.475479), (90.68224, 104.475479), (92.91451, 104.475479), (95.14678, 104.475479), (97.37905, 104.475479), (99.61132, 104.475479), (101.84359, 104.475479), (104.07586, 104.475479), (106.30813, 104.475479), (108.5404, 104.475479), (110.77267, 104.475479), (113.00494, 104.475479), (115.23721, 104.475479), (117.46948, 104.475479), (119.70175, 104.475479), (121.93402, 104.475479), (124.16629, 104.475479), (126.39856, 104.475479), (128.63083, 104.475479), (130.8631, 104.475479), (133.09537, 104.475479), (135.32764, 104.475479), (137.55991, 104.475479), (139.79218, 104.475479), (142.02445, 104.475479), (144.256721, 104.475479), (144.256721, 79.80812)], [(72.824079, 79.80812), (75.05635, 79.80812), (77.28862, 79.80812), (79.52089, 79.80812), (81.75316, 79.80812), (83.98543, 79.80812), (86.2177, 79.80812), (88.44997, 79.80812), (90.68224, 79.80812), (92.91451, 79.80812), (95.14678, 79.80812), (97.37905, 79.80812), (99.61132, 79.80812), (101.84359, 79.80812), (104.07586, 79.80812), (106.30813, 79.80812), (108.5404, 79.80812), (110.77267, 79.80812), (113.00494, 79.80812), (115.23721, 79.80812), (117.46948, 79.80812), (119.70175, 79.80812), (121.93402, 79.80812), (124.16629, 79.80812), (126.39856, 79.80812), (128.63083, 79.80812), (130.8631, 79.80812), (133.09537, 79.80812), (135.32764, 79.80812), (137.55991, 79.80812), (139.79218, 79.80812), (142.02445, 79.80812), (144.256721, 79.80812)], [(72.824079, 79.80812), (72.824079, 104.475479)], [(182.92408, 189.908121), (182.92408, 187.67585), (182.92408, 185.44358), (182.92408, 183.21131), (182.92408, 180.97904), (182.92408, 178.74677), (182.92408, 176.5145), (182.92408, 174.28223), (182.92408, 172.04996), (182.92408, 169.81769), (182.92408, 167.58542), (182.92408, 165.35315), (182.92408, 163.12088), (182.92408, 160.88861), (182.92408, 158.65634), (182.92408, 156.42407), (182.92408, 154.1918), (182.92408, 151.95953), (182.92408, 149.72726), (182.92408, 147.49499), (182.92408, 145.26272), (182.92408, 143.03045), (182.92408, 140.79818), (182.92408, 138.56591), (182.92408, 136.33364), (182.92408, 134.10137), (182.92408, 131.8691), (182.92408, 129.63683), (182.92408, 127.40456), (182.92408, 125.17229), (182.92408, 122.94002), (182.92408, 120.70775), (182.92408, 118.475479)], [(158.256721, 189.908121), (158.256721, 187.67585), (158.256721, 185.44358), (158.256721, 183.21131), (158.256721, 180.97904), (158.256721, 178.74677), (158.256721, 176.5145), (158.256721, 174.28223), (158.256721, 172.04996), (158.256721, 169.81769), (158.256721, 167.58542), (158.256721, 165.35315), (158.256721, 163.12088), (158.256721, 160.88861), (158.256721, 158.65634), (158.256721, 156.42407), (158.256721, 154.1918), (158.256721, 151.95953), (158.256721, 149.72726), (158.256721, 147.49499), (158.256721, 145.26272), (158.256721, 143.03045), (158.256721, 140.79818), (158.256721, 138.56591), (158.256721, 136.33364), (158.256721, 134.10137), (158.256721, 131.8691), (158.256721, 129.63683), (158.256721, 127.40456), (158.256721, 125.17229), (158.256721, 122.94002), (158.256721, 120.70775), (158.256721, 118.475479)], [(158.256721, 189.908121), (182.92408, 189.908121)], [(158.256721, 118.475479), (182.92408, 118.475479)]])\nVISIBLE_CIRCLES = [(108.5404, 154.1918, 35.716321), (108.5404, 154.1918, 26.78724)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(135.3277, 79.8082, 135.3277, 104.4755), (81.7532, 104.4755, 81.7532, 79.8082), (158.2568, 127.4046, 182.9241, 127.4046), (158.2568, 180.9791, 182.9241, 180.9791)]\nDIMENSIONS = [('diameter', '%%c100', (108.5404, 154.1918), 35.7163, 45), ('diameter', '%%c75', (108.5404, 154.1918), 26.7872, 135), ('horizontal', '34.5323', (182.9241, 154.1918), (158.2568, 154.1918), (170.5904, 143.1918))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00665653_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00668897","images":["images/0066_00668897.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 81.25 mm. It is extruded to a thickness of 365.38 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.2064958677685974\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(104.421193, 67.112393), (103.775894, 67.112393), (103.130594, 67.112393), (102.485295, 67.112393), (101.839995, 67.112393), (101.194695, 67.112393), (100.549396, 67.112393), (99.904096, 67.112393), (99.258797, 67.112393), (98.613497, 67.112393), (97.968198, 67.112393), (97.322898, 67.112393), (96.677598, 67.112393), (96.032299, 67.112393), (95.386999, 67.112393), (94.7417, 67.112393), (94.0964, 67.112393), (93.4511, 67.112393), (92.805801, 67.112393), (92.160501, 67.112393), (91.515202, 67.112393), (90.869902, 67.112393), (90.224602, 67.112393), (89.579303, 67.112393), (88.934003, 67.112393), (88.288704, 67.112393), (87.643404, 67.112393), (86.998105, 67.112393), (86.352805, 67.112393), (85.707505, 67.112393), (85.062206, 67.112393), (84.416906, 67.112393), (83.771607, 67.112393)], [(104.421193, 67.112393), (104.421193, 142.562806), (103.775894, 142.562806), (103.130594, 142.562806), (102.485295, 142.562806), (101.839995, 142.562806), (101.194695, 142.562806), (100.549396, 142.562806), (99.904096, 142.562806), (99.258797, 142.562806), (98.613497, 142.562806), (97.968198, 142.562806), (97.322898, 142.562806), (96.677598, 142.562806), (96.032299, 142.562806), (95.386999, 142.562806), (94.7417, 142.562806), (94.0964, 142.562806), (93.4511, 142.562806), (92.805801, 142.562806), (92.160501, 142.562806), (91.515202, 142.562806), (90.869902, 142.562806), (90.224602, 142.562806), (89.579303, 142.562806), (88.934003, 142.562806), (88.288704, 142.562806), (87.643404, 142.562806), (86.998105, 142.562806), (86.352805, 142.562806), (85.707505, 142.562806), (85.062206, 142.562806), (84.416906, 142.562806), (83.771607, 142.562806), (83.771607, 67.112393)], [(118.421194, 156.562807), (118.421194, 157.208106), (118.421194, 157.853406), (118.421194, 158.498705), (118.421194, 159.144005), (118.421194, 159.789305), (118.421194, 160.434604), (118.421194, 161.079904), (118.421194, 161.725203), (118.421194, 162.370503), (118.421194, 163.015802), (118.421194, 163.661102), (118.421194, 164.306402), (118.421194, 164.951701), (118.421194, 165.597001), (118.421194, 166.2423), (118.421194, 166.8876), (118.421194, 167.5329), (118.421194, 168.178199), (118.421194, 168.823499), (118.421194, 169.468798), (118.421194, 170.114098), (118.421194, 170.759398), (118.421194, 171.404697), (118.421194, 172.049997), (118.421194, 172.695296), (118.421194, 173.340596), (118.421194, 173.985895), (118.421194, 174.631195), (118.421194, 175.276495), (118.421194, 175.921794), (118.421194, 176.567094), (118.421194, 177.212393)], [(193.871607, 156.562807), (193.871607, 157.208106), (193.871607, 157.853406), (193.871607, 158.498705), (193.871607, 159.144005), (193.871607, 159.789305), (193.871607, 160.434604), (193.871607, 161.079904), (193.871607, 161.725203), (193.871607, 162.370503), (193.871607, 163.015802), (193.871607, 163.661102), (193.871607, 164.306402), (193.871607, 164.951701), (193.871607, 165.597001), (193.871607, 166.2423), (193.871607, 166.8876), (193.871607, 167.5329), (193.871607, 168.178199), (193.871607, 168.823499), (193.871607, 169.468798), (193.871607, 170.114098), (193.871607, 170.759398), (193.871607, 171.404697), (193.871607, 172.049997), (193.871607, 172.695296), (193.871607, 173.340596), (193.871607, 173.985895), (193.871607, 174.631195), (193.871607, 175.276495), (193.871607, 175.921794), (193.871607, 176.567094), (193.871607, 177.212393)], [(193.871607, 156.562807), (118.421194, 156.562807)], [(193.871607, 177.212393), (118.421194, 177.212393)]])\nVISIBLE_CIRCLES = [(94.0964, 166.8876, 10.324793), (94.0964, 166.8876, 8.388895)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(102.4853, 142.5628, 102.4853, 67.1124), (85.7075, 67.1124, 85.7075, 142.5628), (193.8716, 175.2765, 118.4212, 175.2765), (193.8716, 158.4987, 118.4212, 158.4987)]\nDIMENSIONS = [('diameter', '%%c100', (94.0964, 166.8876), 10.3248, 45), ('diameter', '%%c81.25', (94.0964, 166.8876), 8.3889, 135), ('horizontal', '365.385', (118.4212, 166.8876), (193.8716, 166.8876), (156.1464, 177.8876))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00668897_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0070_00700345","images":["images/0070_00700345.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 41.67 mm. It is extruded to a thickness of 263.89 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.26409160305349966\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(83.77332, 138.24312), (84.598606, 138.24312), (85.423892, 138.24312), (86.249179, 138.24312), (87.074465, 138.24312), (87.899751, 138.24312), (88.725037, 138.24312), (89.550324, 138.24312), (90.37561, 138.24312), (91.200896, 138.24312), (92.026182, 138.24312), (92.851469, 138.24312), (93.676755, 138.24312), (94.502041, 138.24312), (95.327327, 138.24312), (96.152614, 138.24312), (96.9779, 138.24312), (97.803186, 138.24312), (98.628473, 138.24312), (99.453759, 138.24312), (100.279045, 138.24312), (101.104331, 138.24312), (101.929618, 138.24312), (102.754904, 138.24312), (103.58019, 138.24312), (104.405476, 138.24312), (105.230763, 138.24312), (106.056049, 138.24312), (106.881335, 138.24312), (107.706621, 138.24312), (108.531908, 138.24312), (109.357194, 138.24312), (110.18248, 138.24312), (110.18248, 68.55228)], [(83.77332, 68.55228), (84.598606, 68.55228), (85.423892, 68.55228), (86.249179, 68.55228), (87.074465, 68.55228), (87.899751, 68.55228), (88.725037, 68.55228), (89.550324, 68.55228), (90.37561, 68.55228), (91.200896, 68.55228), (92.026182, 68.55228), (92.851469, 68.55228), (93.676755, 68.55228), (94.502041, 68.55228), (95.327327, 68.55228), (96.152614, 68.55228), (96.9779, 68.55228), (97.803186, 68.55228), (98.628473, 68.55228), (99.453759, 68.55228), (100.279045, 68.55228), (101.104331, 68.55228), (101.929618, 68.55228), (102.754904, 68.55228), (103.58019, 68.55228), (104.405476, 68.55228), (105.230763, 68.55228), (106.056049, 68.55228), (106.881335, 68.55228), (107.706621, 68.55228), (108.531908, 68.55228), (109.357194, 68.55228), (110.18248, 68.55228)], [(83.77332, 68.55228), (83.77332, 138.24312)], [(193.87332, 178.65228), (193.87332, 177.826994), (193.87332, 177.001708), (193.87332, 176.176421), (193.87332, 175.351135), (193.87332, 174.525849), (193.87332, 173.700563), (193.87332, 172.875276), (193.87332, 172.04999), (193.87332, 171.224704), (193.87332, 170.399418), (193.87332, 169.574131), (193.87332, 168.748845), (193.87332, 167.923559), (193.87332, 167.098273), (193.87332, 166.272986), (193.87332, 165.4477), (193.87332, 164.622414), (193.87332, 163.797127), (193.87332, 162.971841), (193.87332, 162.146555), (193.87332, 161.321269), (193.87332, 160.495982), (193.87332, 159.670696), (193.87332, 158.84541), (193.87332, 158.020124), (193.87332, 157.194837), (193.87332, 156.369551), (193.87332, 155.544265), (193.87332, 154.718979), (193.87332, 153.893692), (193.87332, 153.068406), (193.87332, 152.24312)], [(124.18248, 178.65228), (124.18248, 177.826994), (124.18248, 177.001708), (124.18248, 176.176421), (124.18248, 175.351135), (124.18248, 174.525849), (124.18248, 173.700563), (124.18248, 172.875276), (124.18248, 172.04999), (124.18248, 171.224704), (124.18248, 170.399418), (124.18248, 169.574131), (124.18248, 168.748845), (124.18248, 167.923559), (124.18248, 167.098273), (124.18248, 166.272986), (124.18248, 165.4477), (124.18248, 164.622414), (124.18248, 163.797127), (124.18248, 162.971841), (124.18248, 162.146555), (124.18248, 161.321269), (124.18248, 160.495982), (124.18248, 159.670696), (124.18248, 158.84541), (124.18248, 158.020124), (124.18248, 157.194837), (124.18248, 156.369551), (124.18248, 155.544265), (124.18248, 154.718979), (124.18248, 153.893692), (124.18248, 153.068406), (124.18248, 152.24312)], [(124.18248, 178.65228), (193.87332, 178.65228)], [(124.18248, 152.24312), (193.87332, 152.24312)]])\nVISIBLE_CIRCLES = [(96.9779, 165.4477, 13.20458), (96.9779, 165.4477, 5.501908)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(102.4799, 68.5523, 102.4799, 138.2431), (91.476, 138.2431, 91.476, 68.5523), (124.1825, 159.9458, 193.8734, 159.9458), (124.1825, 170.9496, 193.8734, 170.9496)]\nDIMENSIONS = [('diameter', '%%c100', (96.9779, 165.4477), 13.2046, 45), ('diameter', '%%c41.6667', (96.9779, 165.4477), 5.5019, 135), ('horizontal', '263.889', (193.8734, 165.4477), (124.1825, 165.4477), (159.028, 154.4477))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0070_00700345_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0072_00725484","images":["images/0072_00725484.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 85.42 mm. It is extruded to a thickness of 40.72 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6829298685276238\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(72.621607, 106.830306), (74.755762, 106.830306), (76.889918, 106.830306), (79.024074, 106.830306), (81.15823, 106.830306), (83.292386, 106.830306), (85.426542, 106.830306), (87.560697, 106.830306), (89.694853, 106.830306), (91.829009, 106.830306), (93.963165, 106.830306), (96.097321, 106.830306), (98.231477, 106.830306), (100.365632, 106.830306), (102.499788, 106.830306), (104.633944, 106.830306), (106.7681, 106.830306), (108.902256, 106.830306), (111.036412, 106.830306), (113.170568, 106.830306), (115.304723, 106.830306), (117.438879, 106.830306), (119.573035, 106.830306), (121.707191, 106.830306), (123.841347, 106.830306), (125.975503, 106.830306), (128.109658, 106.830306), (130.243814, 106.830306), (132.37797, 106.830306), (134.512126, 106.830306), (136.646282, 106.830306), (138.780438, 106.830306), (140.914593, 106.830306), (140.914593, 79.023293)], [(72.621607, 79.023293), (74.755762, 79.023293), (76.889918, 79.023293), (79.024074, 79.023293), (81.15823, 79.023293), (83.292386, 79.023293), (85.426542, 79.023293), (87.560697, 79.023293), (89.694853, 79.023293), (91.829009, 79.023293), (93.963165, 79.023293), (96.097321, 79.023293), (98.231477, 79.023293), (100.365632, 79.023293), (102.499788, 79.023293), (104.633944, 79.023293), (106.7681, 79.023293), (108.902256, 79.023293), (111.036412, 79.023293), (113.170568, 79.023293), (115.304723, 79.023293), (117.438879, 79.023293), (119.573035, 79.023293), (121.707191, 79.023293), (123.841347, 79.023293), (125.975503, 79.023293), (128.109658, 79.023293), (130.243814, 79.023293), (132.37797, 79.023293), (134.512126, 79.023293), (136.646282, 79.023293), (138.780438, 79.023293), (140.914593, 79.023293)], [(72.621607, 79.023293), (72.621607, 106.830306)], [(182.721607, 189.123293), (182.721607, 186.989138), (182.721607, 184.854982), (182.721607, 182.720826), (182.721607, 180.58667), (182.721607, 178.452514), (182.721607, 176.318358), (182.721607, 174.184203), (182.721607, 172.050047), (182.721607, 169.915891), (182.721607, 167.781735), (182.721607, 165.647579), (182.721607, 163.513423), (182.721607, 161.379268), (182.721607, 159.245112), (182.721607, 157.110956), (182.721607, 154.9768), (182.721607, 152.842644), (182.721607, 150.708488), (182.721607, 148.574332), (182.721607, 146.440177), (182.721607, 144.306021), (182.721607, 142.171865), (182.721607, 140.037709), (182.721607, 137.903553), (182.721607, 135.769397), (182.721607, 133.635242), (182.721607, 131.501086), (182.721607, 129.36693), (182.721607, 127.232774), (182.721607, 125.098618), (182.721607, 122.964462), (182.721607, 120.830307)], [(154.914594, 189.123293), (154.914594, 186.989138), (154.914594, 184.854982), (154.914594, 182.720826), (154.914594, 180.58667), (154.914594, 178.452514), (154.914594, 176.318358), (154.914594, 174.184203), (154.914594, 172.050047), (154.914594, 169.915891), (154.914594, 167.781735), (154.914594, 165.647579), (154.914594, 163.513423), (154.914594, 161.379268), (154.914594, 159.245112), (154.914594, 157.110956), (154.914594, 154.9768), (154.914594, 152.842644), (154.914594, 150.708488), (154.914594, 148.574332), (154.914594, 146.440177), (154.914594, 144.306021), (154.914594, 142.171865), (154.914594, 140.037709), (154.914594, 137.903553), (154.914594, 135.769397), (154.914594, 133.635242), (154.914594, 131.501086), (154.914594, 129.36693), (154.914594, 127.232774), (154.914594, 125.098618), (154.914594, 122.964462), (154.914594, 120.830307)], [(154.914594, 189.123293), (182.721607, 189.123293)], [(154.914594, 120.830307), (182.721607, 120.830307)]])\nVISIBLE_CIRCLES = [(106.7681, 154.9768, 34.146493), (106.7681, 154.9768, 29.166796)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(135.935, 79.0232, 135.935, 106.8303), (77.6014, 106.8303, 77.6014, 79.0232), (154.9147, 125.81, 182.7217, 125.81), (154.9147, 184.1435, 182.7217, 184.1435)]\nDIMENSIONS = [('diameter', '%%c100', (106.7681, 154.9768), 34.1465, 45), ('diameter', '%%c85.4167', (106.7681, 154.9768), 29.1668, 135), ('horizontal', '40.7172', (182.7217, 154.9768), (154.9147, 154.9768), (168.8182, 143.9768))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0072_00725484_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0079_00797216","images":["images/0079_00797216.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 62.5 mm. It is extruded to a thickness of 19.59 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8036091098811375\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(152.487555, 82.040255), (149.976277, 82.040255), (147.464999, 82.040255), (144.95372, 82.040255), (142.442442, 82.040255), (139.931163, 82.040255), (137.419885, 82.040255), (134.908606, 82.040255), (132.397328, 82.040255), (129.886049, 82.040255), (127.374771, 82.040255), (124.863492, 82.040255), (122.352214, 82.040255), (119.840935, 82.040255), (117.329657, 82.040255), (114.818378, 82.040255), (112.3071, 82.040255), (109.795822, 82.040255), (107.284543, 82.040255), (104.773265, 82.040255), (102.261986, 82.040255), (99.750708, 82.040255), (97.239429, 82.040255), (94.728151, 82.040255), (92.216872, 82.040255), (89.705594, 82.040255), (87.194315, 82.040255), (84.683037, 82.040255), (82.171758, 82.040255), (79.66048, 82.040255), (77.149201, 82.040255), (74.637923, 82.040255), (72.126645, 82.040255)], [(152.487555, 82.040255), (152.487555, 97.779344), (149.976277, 97.779344), (147.464999, 97.779344), (144.95372, 97.779344), (142.442442, 97.779344), (139.931163, 97.779344), (137.419885, 97.779344), (134.908606, 97.779344), (132.397328, 97.779344), (129.886049, 97.779344), (127.374771, 97.779344), (124.863492, 97.779344), (122.352214, 97.779344), (119.840935, 97.779344), (117.329657, 97.779344), (114.818378, 97.779344), (112.3071, 97.779344), (109.795822, 97.779344), (107.284543, 97.779344), (104.773265, 97.779344), (102.261986, 97.779344), (99.750708, 97.779344), (97.239429, 97.779344), (94.728151, 97.779344), (92.216872, 97.779344), (89.705594, 97.779344), (87.194315, 97.779344), (84.683037, 97.779344), (82.171758, 97.779344), (79.66048, 97.779344), (77.149201, 97.779344), (74.637923, 97.779344), (72.126645, 97.779344), (72.126645, 82.040255)], [(166.487556, 111.779345), (166.487556, 114.290623), (166.487556, 116.801901), (166.487556, 119.31318), (166.487556, 121.824458), (166.487556, 124.335737), (166.487556, 126.847015), (166.487556, 129.358294), (166.487556, 131.869572), (166.487556, 134.380851), (166.487556, 136.892129), (166.487556, 139.403408), (166.487556, 141.914686), (166.487556, 144.425965), (166.487556, 146.937243), (166.487556, 149.448522), (166.487556, 151.9598), (166.487556, 154.471078), (166.487556, 156.982357), (166.487556, 159.493635), (166.487556, 162.004914), (166.487556, 164.516192), (166.487556, 167.027471), (166.487556, 169.538749), (166.487556, 172.050028), (166.487556, 174.561306), (166.487556, 177.072585), (166.487556, 179.583863), (166.487556, 182.095142), (166.487556, 184.60642), (166.487556, 187.117699), (166.487556, 189.628977), (166.487556, 192.140255)], [(182.226645, 111.779345), (182.226645, 114.290623), (182.226645, 116.801901), (182.226645, 119.31318), (182.226645, 121.824458), (182.226645, 124.335737), (182.226645, 126.847015), (182.226645, 129.358294), (182.226645, 131.869572), (182.226645, 134.380851), (182.226645, 136.892129), (182.226645, 139.403408), (182.226645, 141.914686), (182.226645, 144.425965), (182.226645, 146.937243), (182.226645, 149.448522), (182.226645, 151.9598), (182.226645, 154.471078), (182.226645, 156.982357), (182.226645, 159.493635), (182.226645, 162.004914), (182.226645, 164.516192), (182.226645, 167.027471), (182.226645, 169.538749), (182.226645, 172.050028), (182.226645, 174.561306), (182.226645, 177.072585), (182.226645, 179.583863), (182.226645, 182.095142), (182.226645, 184.60642), (182.226645, 187.117699), (182.226645, 189.628977), (182.226645, 192.140255)], [(182.226645, 111.779345), (166.487556, 111.779345)], [(182.226645, 192.140255), (166.487556, 192.140255)]])\nVISIBLE_CIRCLES = [(112.3071, 151.9598, 40.180455), (112.3071, 151.9598, 25.112785)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(137.4199, 97.7793, 137.4199, 82.0402), (87.1944, 82.0402, 87.1944, 97.7793), (182.2267, 177.0726, 166.4876, 177.0726), (182.2267, 126.847, 166.4876, 126.847)]\nDIMENSIONS = [('diameter', '%%c100', (112.3071, 151.9598), 40.1805, 45), ('diameter', '%%c62.5', (112.3071, 151.9598), 25.1128, 135), ('horizontal', '19.5855', (166.4876, 151.9598), (182.2267, 151.9598), (174.3571, 162.9598))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0079_00797216_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0080_00807571","images":["images/0080_00807571.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 52.08 mm. It is extruded to a thickness of 9.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8752854672135206\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(159.338973, 83.832173), (156.603706, 83.832173), (153.868439, 83.832173), (151.133172, 83.832173), (148.397905, 83.832173), (145.662638, 83.832173), (142.927371, 83.832173), (140.192104, 83.832173), (137.456837, 83.832173), (134.72157, 83.832173), (131.986303, 83.832173), (129.251035, 83.832173), (126.515768, 83.832173), (123.780501, 83.832173), (121.045234, 83.832173), (118.309967, 83.832173), (115.5747, 83.832173), (112.839433, 83.832173), (110.104166, 83.832173), (107.368899, 83.832173), (104.633632, 83.832173), (101.898365, 83.832173), (99.163097, 83.832173), (96.42783, 83.832173), (93.692563, 83.832173), (90.957296, 83.832173), (88.222029, 83.832173), (85.486762, 83.832173), (82.751495, 83.832173), (80.016228, 83.832173), (77.280961, 83.832173), (74.545694, 83.832173), (71.810427, 83.832173)], [(159.338973, 83.832173), (159.338973, 92.403626), (156.603706, 92.403626), (153.868439, 92.403626), (151.133172, 92.403626), (148.397905, 92.403626), (145.662638, 92.403626), (142.927371, 92.403626), (140.192104, 92.403626), (137.456837, 92.403626), (134.72157, 92.403626), (131.986303, 92.403626), (129.251035, 92.403626), (126.515768, 92.403626), (123.780501, 92.403626), (121.045234, 92.403626), (118.309967, 92.403626), (115.5747, 92.403626), (112.839433, 92.403626), (110.104166, 92.403626), (107.368899, 92.403626), (104.633632, 92.403626), (101.898365, 92.403626), (99.163097, 92.403626), (96.42783, 92.403626), (93.692563, 92.403626), (90.957296, 92.403626), (88.222029, 92.403626), (85.486762, 92.403626), (82.751495, 92.403626), (80.016228, 92.403626), (77.280961, 92.403626), (74.545694, 92.403626), (71.810427, 92.403626), (71.810427, 83.832173)], [(173.338974, 106.403627), (173.338974, 109.138894), (173.338974, 111.874161), (173.338974, 114.609428), (173.338974, 117.344695), (173.338974, 120.079962), (173.338974, 122.815229), (173.338974, 125.550496), (173.338974, 128.285763), (173.338974, 131.02103), (173.338974, 133.756297), (173.338974, 136.491565), (173.338974, 139.226832), (173.338974, 141.962099), (173.338974, 144.697366), (173.338974, 147.432633), (173.338974, 150.1679), (173.338974, 152.903167), (173.338974, 155.638434), (173.338974, 158.373701), (173.338974, 161.108968), (173.338974, 163.844235), (173.338974, 166.579503), (173.338974, 169.31477), (173.338974, 172.050037), (173.338974, 174.785304), (173.338974, 177.520571), (173.338974, 180.255838), (173.338974, 182.991105), (173.338974, 185.726372), (173.338974, 188.461639), (173.338974, 191.196906), (173.338974, 193.932173)], [(181.910427, 106.403627), (181.910427, 109.138894), (181.910427, 111.874161), (181.910427, 114.609428), (181.910427, 117.344695), (181.910427, 120.079962), (181.910427, 122.815229), (181.910427, 125.550496), (181.910427, 128.285763), (181.910427, 131.02103), (181.910427, 133.756297), (181.910427, 136.491565), (181.910427, 139.226832), (181.910427, 141.962099), (181.910427, 144.697366), (181.910427, 147.432633), (181.910427, 150.1679), (181.910427, 152.903167), (181.910427, 155.638434), (181.910427, 158.373701), (181.910427, 161.108968), (181.910427, 163.844235), (181.910427, 166.579503), (181.910427, 169.31477), (181.910427, 172.050037), (181.910427, 174.785304), (181.910427, 177.520571), (181.910427, 180.255838), (181.910427, 182.991105), (181.910427, 185.726372), (181.910427, 188.461639), (181.910427, 191.196906), (181.910427, 193.932173)], [(181.910427, 106.403627), (173.338974, 106.403627)], [(181.910427, 193.932173), (173.338974, 193.932173)]])\nVISIBLE_CIRCLES = [(115.5747, 150.1679, 43.764273), (115.5747, 150.1679, 22.793892)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(138.3686, 92.4036, 138.3686, 83.8321), (92.7808, 83.8321, 92.7808, 92.4036), (181.9105, 172.9618, 173.339, 172.9618), (181.9105, 127.374, 173.339, 127.374)]\nDIMENSIONS = [('diameter', '%%c100', (115.5747, 150.1679), 43.7643, 45), ('diameter', '%%c52.0833', (115.5747, 150.1679), 22.7939, 135), ('horizontal', '9.7928', (173.339, 150.1679), (181.9105, 150.1679), (177.6248, 161.1679))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0080_00807571_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00826930","images":["images/0082_00826930.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 45.83 mm. It is extruded to a thickness of 16.49 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8249418777943337\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(155.906194, 82.573594), (153.328251, 82.573594), (150.750307, 82.573594), (148.172364, 82.573594), (145.59442, 82.573594), (143.016477, 82.573594), (140.438534, 82.573594), (137.86059, 82.573594), (135.282647, 82.573594), (132.704704, 82.573594), (130.12676, 82.573594), (127.548817, 82.573594), (124.970873, 82.573594), (122.39293, 82.573594), (119.814987, 82.573594), (117.237043, 82.573594), (114.6591, 82.573594), (112.081157, 82.573594), (109.503213, 82.573594), (106.92527, 82.573594), (104.347327, 82.573594), (101.769383, 82.573594), (99.19144, 82.573594), (96.613496, 82.573594), (94.035553, 82.573594), (91.45761, 82.573594), (88.879666, 82.573594), (86.301723, 82.573594), (83.72378, 82.573594), (81.145836, 82.573594), (78.567893, 82.573594), (75.989949, 82.573594), (73.412006, 82.573594)], [(155.906194, 82.573594), (155.906194, 96.179406), (153.328251, 96.179406), (150.750307, 96.179406), (148.172364, 96.179406), (145.59442, 96.179406), (143.016477, 96.179406), (140.438534, 96.179406), (137.86059, 96.179406), (135.282647, 96.179406), (132.704704, 96.179406), (130.12676, 96.179406), (127.548817, 96.179406), (124.970873, 96.179406), (122.39293, 96.179406), (119.814987, 96.179406), (117.237043, 96.179406), (114.6591, 96.179406), (112.081157, 96.179406), (109.503213, 96.179406), (106.92527, 96.179406), (104.347327, 96.179406), (101.769383, 96.179406), (99.19144, 96.179406), (96.613496, 96.179406), (94.035553, 96.179406), (91.45761, 96.179406), (88.879666, 96.179406), (86.301723, 96.179406), (83.72378, 96.179406), (81.145836, 96.179406), (78.567893, 96.179406), (75.989949, 96.179406), (73.412006, 96.179406), (73.412006, 82.573594)], [(169.906194, 110.179406), (169.906194, 112.757349), (169.906194, 115.335293), (169.906194, 117.913236), (169.906194, 120.49118), (169.906194, 123.069123), (169.906194, 125.647066), (169.906194, 128.22501), (169.906194, 130.802953), (169.906194, 133.380896), (169.906194, 135.95884), (169.906194, 138.536783), (169.906194, 141.114727), (169.906194, 143.69267), (169.906194, 146.270613), (169.906194, 148.848557), (169.906194, 151.4265), (169.906194, 154.004443), (169.906194, 156.582387), (169.906194, 159.16033), (169.906194, 161.738273), (169.906194, 164.316217), (169.906194, 166.89416), (169.906194, 169.472104), (169.906194, 172.050047), (169.906194, 174.62799), (169.906194, 177.205934), (169.906194, 179.783877), (169.906194, 182.36182), (169.906194, 184.939764), (169.906194, 187.517707), (169.906194, 190.095651), (169.906194, 192.673594)], [(183.512006, 110.179406), (183.512006, 112.757349), (183.512006, 115.335293), (183.512006, 117.913236), (183.512006, 120.49118), (183.512006, 123.069123), (183.512006, 125.647066), (183.512006, 128.22501), (183.512006, 130.802953), (183.512006, 133.380896), (183.512006, 135.95884), (183.512006, 138.536783), (183.512006, 141.114727), (183.512006, 143.69267), (183.512006, 146.270613), (183.512006, 148.848557), (183.512006, 151.4265), (183.512006, 154.004443), (183.512006, 156.582387), (183.512006, 159.16033), (183.512006, 161.738273), (183.512006, 164.316217), (183.512006, 166.89416), (183.512006, 169.472104), (183.512006, 172.050047), (183.512006, 174.62799), (183.512006, 177.205934), (183.512006, 179.783877), (183.512006, 182.36182), (183.512006, 184.939764), (183.512006, 187.517707), (183.512006, 190.095651), (183.512006, 192.673594)], [(183.512006, 110.179406), (169.906194, 110.179406)], [(183.512006, 192.673594), (169.906194, 192.673594)]])\nVISIBLE_CIRCLES = [(114.6591, 151.4265, 41.247094), (114.6591, 151.4265, 18.904918)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(133.564, 96.1794, 133.564, 82.5735), (95.7542, 82.5735, 95.7542, 96.1794), (183.512, 170.3314, 169.9062, 170.3314), (183.512, 132.5215, 169.9062, 132.5215)]\nDIMENSIONS = [('diameter', '%%c100', (114.6591, 151.4265), 41.2471, 45), ('diameter', '%%c45.8333', (114.6591, 151.4265), 18.9049, 135), ('horizontal', '16.4931', (169.9062, 151.4265), (183.512, 151.4265), (176.7091, 162.4265))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00826930_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0084_00842316","images":["images/0084_00842316.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 79.17 mm. It is extruded to a thickness of 186.27 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3356917808219431\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(80.931911, 132.873111), (81.980948, 132.873111), (83.029985, 132.873111), (84.079021, 132.873111), (85.128058, 132.873111), (86.177095, 132.873111), (87.226132, 132.873111), (88.275169, 132.873111), (89.324205, 132.873111), (90.373242, 132.873111), (91.422279, 132.873111), (92.471316, 132.873111), (93.520353, 132.873111), (94.56939, 132.873111), (95.618426, 132.873111), (96.667463, 132.873111), (97.7165, 132.873111), (98.765537, 132.873111), (99.814574, 132.873111), (100.86361, 132.873111), (101.912647, 132.873111), (102.961684, 132.873111), (104.010721, 132.873111), (105.059758, 132.873111), (106.108795, 132.873111), (107.157831, 132.873111), (108.206868, 132.873111), (109.255905, 132.873111), (110.304942, 132.873111), (111.353979, 132.873111), (112.403015, 132.873111), (113.452052, 132.873111), (114.501089, 132.873111), (114.501089, 70.342289)], [(80.931911, 70.342289), (81.980948, 70.342289), (83.029985, 70.342289), (84.079021, 70.342289), (85.128058, 70.342289), (86.177095, 70.342289), (87.226132, 70.342289), (88.275169, 70.342289), (89.324205, 70.342289), (90.373242, 70.342289), (91.422279, 70.342289), (92.471316, 70.342289), (93.520353, 70.342289), (94.56939, 70.342289), (95.618426, 70.342289), (96.667463, 70.342289), (97.7165, 70.342289), (98.765537, 70.342289), (99.814574, 70.342289), (100.86361, 70.342289), (101.912647, 70.342289), (102.961684, 70.342289), (104.010721, 70.342289), (105.059758, 70.342289), (106.108795, 70.342289), (107.157831, 70.342289), (108.206868, 70.342289), (109.255905, 70.342289), (110.304942, 70.342289), (111.353979, 70.342289), (112.403015, 70.342289), (113.452052, 70.342289), (114.501089, 70.342289)], [(80.931911, 70.342289), (80.931911, 132.873111)], [(191.031911, 180.442289), (191.031911, 179.393252), (191.031911, 178.344215), (191.031911, 177.295179), (191.031911, 176.246142), (191.031911, 175.197105), (191.031911, 174.148068), (191.031911, 173.099031), (191.031911, 172.049995), (191.031911, 171.000958), (191.031911, 169.951921), (191.031911, 168.902884), (191.031911, 167.853847), (191.031911, 166.80481), (191.031911, 165.755774), (191.031911, 164.706737), (191.031911, 163.6577), (191.031911, 162.608663), (191.031911, 161.559626), (191.031911, 160.51059), (191.031911, 159.461553), (191.031911, 158.412516), (191.031911, 157.363479), (191.031911, 156.314442), (191.031911, 155.265405), (191.031911, 154.216369), (191.031911, 153.167332), (191.031911, 152.118295), (191.031911, 151.069258), (191.031911, 150.020221), (191.031911, 148.971185), (191.031911, 147.922148), (191.031911, 146.873111)], [(128.501089, 180.442289), (128.501089, 179.393252), (128.501089, 178.344215), (128.501089, 177.295179), (128.501089, 176.246142), (128.501089, 175.197105), (128.501089, 174.148068), (128.501089, 173.099031), (128.501089, 172.049995), (128.501089, 171.000958), (128.501089, 169.951921), (128.501089, 168.902884), (128.501089, 167.853847), (128.501089, 166.80481), (128.501089, 165.755774), (128.501089, 164.706737), (128.501089, 163.6577), (128.501089, 162.608663), (128.501089, 161.559626), (128.501089, 160.51059), (128.501089, 159.461553), (128.501089, 158.412516), (128.501089, 157.363479), (128.501089, 156.314442), (128.501089, 155.265405), (128.501089, 154.216369), (128.501089, 153.167332), (128.501089, 152.118295), (128.501089, 151.069258), (128.501089, 150.020221), (128.501089, 148.971185), (128.501089, 147.922148), (128.501089, 146.873111)], [(128.501089, 180.442289), (191.031911, 180.442289)], [(128.501089, 146.873111), (191.031911, 146.873111)]])\nVISIBLE_CIRCLES = [(97.7165, 163.6577, 16.784589), (97.7165, 163.6577, 13.2878)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(111.0043, 70.3423, 111.0043, 132.8731), (84.4287, 132.8731, 84.4287, 70.3423), (128.5011, 150.3699, 191.0319, 150.3699), (128.5011, 176.9455, 191.0319, 176.9455)]\nDIMENSIONS = [('diameter', '%%c100', (97.7165, 163.6577), 16.7846, 45), ('diameter', '%%c79.1667', (97.7165, 163.6577), 13.2878, 135), ('horizontal', '186.274', (191.0319, 163.6577), (128.5011, 163.6577), (159.7665, 152.6577))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0084_00842316_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0089_00890621","images":["images/0089_00890621.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 75 mm. It is extruded to a thickness of 3.61 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9275358433261749\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(160.913692, 85.138392), (158.015143, 85.138392), (155.116593, 85.138392), (152.218044, 85.138392), (149.319494, 85.138392), (146.420945, 85.138392), (143.522395, 85.138392), (140.623846, 85.138392), (137.725296, 85.138392), (134.826747, 85.138392), (131.928197, 85.138392), (129.029648, 85.138392), (126.131098, 85.138392), (123.232549, 85.138392), (120.333999, 85.138392), (117.43545, 85.138392), (114.5369, 85.138392), (111.63835, 85.138392), (108.739801, 85.138392), (105.841251, 85.138392), (102.942702, 85.138392), (100.044152, 85.138392), (97.145603, 85.138392), (94.247053, 85.138392), (91.348504, 85.138392), (88.449954, 85.138392), (85.551405, 85.138392), (82.652855, 85.138392), (79.754306, 85.138392), (76.855756, 85.138392), (73.957207, 85.138392), (71.058657, 85.138392), (68.160108, 85.138392)], [(160.913692, 85.138392), (160.913692, 88.484808), (158.015143, 88.484808), (155.116593, 88.484808), (152.218044, 88.484808), (149.319494, 88.484808), (146.420945, 88.484808), (143.522395, 88.484808), (140.623846, 88.484808), (137.725296, 88.484808), (134.826747, 88.484808), (131.928197, 88.484808), (129.029648, 88.484808), (126.131098, 88.484808), (123.232549, 88.484808), (120.333999, 88.484808), (117.43545, 88.484808), (114.5369, 88.484808), (111.63835, 88.484808), (108.739801, 88.484808), (105.841251, 88.484808), (102.942702, 88.484808), (100.044152, 88.484808), (97.145603, 88.484808), (94.247053, 88.484808), (91.348504, 88.484808), (88.449954, 88.484808), (85.551405, 88.484808), (82.652855, 88.484808), (79.754306, 88.484808), (76.855756, 88.484808), (73.957207, 88.484808), (71.058657, 88.484808), (68.160108, 88.484808), (68.160108, 85.138392)], [(174.913692, 102.484808), (174.913692, 105.383357), (174.913692, 108.281907), (174.913692, 111.180456), (174.913692, 114.079006), (174.913692, 116.977555), (174.913692, 119.876105), (174.913692, 122.774654), (174.913692, 125.673204), (174.913692, 128.571753), (174.913692, 131.470303), (174.913692, 134.368852), (174.913692, 137.267402), (174.913692, 140.165951), (174.913692, 143.064501), (174.913692, 145.96305), (174.913692, 148.8616), (174.913692, 151.76015), (174.913692, 154.658699), (174.913692, 157.557249), (174.913692, 160.455798), (174.913692, 163.354348), (174.913692, 166.252897), (174.913692, 169.151447), (174.913692, 172.049996), (174.913692, 174.948546), (174.913692, 177.847095), (174.913692, 180.745645), (174.913692, 183.644194), (174.913692, 186.542744), (174.913692, 189.441293), (174.913692, 192.339843), (174.913692, 195.238392)], [(178.260108, 102.484808), (178.260108, 105.383357), (178.260108, 108.281907), (178.260108, 111.180456), (178.260108, 114.079006), (178.260108, 116.977555), (178.260108, 119.876105), (178.260108, 122.774654), (178.260108, 125.673204), (178.260108, 128.571753), (178.260108, 131.470303), (178.260108, 134.368852), (178.260108, 137.267402), (178.260108, 140.165951), (178.260108, 143.064501), (178.260108, 145.96305), (178.260108, 148.8616), (178.260108, 151.76015), (178.260108, 154.658699), (178.260108, 157.557249), (178.260108, 160.455798), (178.260108, 163.354348), (178.260108, 166.252897), (178.260108, 169.151447), (178.260108, 172.049996), (178.260108, 174.948546), (178.260108, 177.847095), (178.260108, 180.745645), (178.260108, 183.644194), (178.260108, 186.542744), (178.260108, 189.441293), (178.260108, 192.339843), (178.260108, 195.238392)], [(178.260108, 102.484808), (174.913692, 102.484808)], [(178.260108, 195.238392), (174.913692, 195.238392)]])\nVISIBLE_CIRCLES = [(114.5369, 148.8616, 46.376792), (114.5369, 148.8616, 34.782594)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(149.3195, 88.4848, 149.3195, 85.1384), (79.7544, 85.1384, 79.7544, 88.4848), (178.2602, 183.6442, 174.9137, 183.6442), (178.2602, 114.079, 174.9137, 114.079)]\nDIMENSIONS = [('diameter', '%%c100', (114.5369, 148.8616), 46.3768, 45), ('diameter', '%%c75', (114.5369, 148.8616), 34.7826, 135), ('horizontal', '3.6079', (174.9137, 148.8616), (178.2602, 148.8616), (176.587, 159.8616))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0089_00890621_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0095_00953755","images":["images/0095_00953755.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 72.92 mm. It is extruded to a thickness of 83.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5241818181818192\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(129.538191, 75.054591), (127.900123, 75.054591), (126.262055, 75.054591), (124.623986, 75.054591), (122.985918, 75.054591), (121.34785, 75.054591), (119.709782, 75.054591), (118.071714, 75.054591), (116.433645, 75.054591), (114.795577, 75.054591), (113.157509, 75.054591), (111.519441, 75.054591), (109.881373, 75.054591), (108.243305, 75.054591), (106.605236, 75.054591), (104.967168, 75.054591), (103.3291, 75.054591), (101.691032, 75.054591), (100.052964, 75.054591), (98.414895, 75.054591), (96.776827, 75.054591), (95.138759, 75.054591), (93.500691, 75.054591), (91.862623, 75.054591), (90.224555, 75.054591), (88.586486, 75.054591), (86.948418, 75.054591), (85.31035, 75.054591), (83.672282, 75.054591), (82.034214, 75.054591), (80.396145, 75.054591), (78.758077, 75.054591), (77.120009, 75.054591)], [(129.538191, 75.054591), (129.538191, 118.736409), (127.900123, 118.736409), (126.262055, 118.736409), (124.623986, 118.736409), (122.985918, 118.736409), (121.34785, 118.736409), (119.709782, 118.736409), (118.071714, 118.736409), (116.433645, 118.736409), (114.795577, 118.736409), (113.157509, 118.736409), (111.519441, 118.736409), (109.881373, 118.736409), (108.243305, 118.736409), (106.605236, 118.736409), (104.967168, 118.736409), (103.3291, 118.736409), (101.691032, 118.736409), (100.052964, 118.736409), (98.414895, 118.736409), (96.776827, 118.736409), (95.138759, 118.736409), (93.500691, 118.736409), (91.862623, 118.736409), (90.224555, 118.736409), (88.586486, 118.736409), (86.948418, 118.736409), (85.31035, 118.736409), (83.672282, 118.736409), (82.034214, 118.736409), (80.396145, 118.736409), (78.758077, 118.736409), (77.120009, 118.736409), (77.120009, 75.054591)], [(143.538191, 132.736409), (143.538191, 134.374477), (143.538191, 136.012545), (143.538191, 137.650614), (143.538191, 139.288682), (143.538191, 140.92675), (143.538191, 142.564818), (143.538191, 144.202886), (143.538191, 145.840955), (143.538191, 147.479023), (143.538191, 149.117091), (143.538191, 150.755159), (143.538191, 152.393227), (143.538191, 154.031295), (143.538191, 155.669364), (143.538191, 157.307432), (143.538191, 158.9455), (143.538191, 160.583568), (143.538191, 162.221636), (143.538191, 163.859705), (143.538191, 165.497773), (143.538191, 167.135841), (143.538191, 168.773909), (143.538191, 170.411977), (143.538191, 172.050045), (143.538191, 173.688114), (143.538191, 175.326182), (143.538191, 176.96425), (143.538191, 178.602318), (143.538191, 180.240386), (143.538191, 181.878455), (143.538191, 183.516523), (143.538191, 185.154591)], [(187.220009, 132.736409), (187.220009, 134.374477), (187.220009, 136.012545), (187.220009, 137.650614), (187.220009, 139.288682), (187.220009, 140.92675), (187.220009, 142.564818), (187.220009, 144.202886), (187.220009, 145.840955), (187.220009, 147.479023), (187.220009, 149.117091), (187.220009, 150.755159), (187.220009, 152.393227), (187.220009, 154.031295), (187.220009, 155.669364), (187.220009, 157.307432), (187.220009, 158.9455), (187.220009, 160.583568), (187.220009, 162.221636), (187.220009, 163.859705), (187.220009, 165.497773), (187.220009, 167.135841), (187.220009, 168.773909), (187.220009, 170.411977), (187.220009, 172.050045), (187.220009, 173.688114), (187.220009, 175.326182), (187.220009, 176.96425), (187.220009, 178.602318), (187.220009, 180.240386), (187.220009, 181.878455), (187.220009, 183.516523), (187.220009, 185.154591)], [(187.220009, 132.736409), (143.538191, 132.736409)], [(187.220009, 185.154591), (143.538191, 185.154591)]])\nVISIBLE_CIRCLES = [(103.3291, 158.9455, 26.209091), (103.3291, 158.9455, 19.110795)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(122.4399, 118.7364, 122.4399, 75.0545), (84.2183, 75.0545, 84.2183, 118.7364), (187.22, 178.0563, 143.5382, 178.0563), (187.22, 139.8347, 143.5382, 139.8347)]\nDIMENSIONS = [('diameter', '%%c100', (103.3291, 158.9455), 26.2091, 45), ('diameter', '%%c72.9167', (103.3291, 158.9455), 19.1108, 135), ('horizontal', '83.3333', (143.5382, 158.9455), (187.22, 158.9455), (165.3791, 169.9455))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0095_00953755_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0003_00032913","images":["images/0003_00032913.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 65.26 mm tall, featuring a circular hole of diameter 23.16 mm. It is extruded to a thickness of 43.75 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8815449607724789\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(161.293477, 172.049978), (161.293477, 114.51757), (73.138981, 114.51757), (73.138981, 172.049978), (161.293477, 172.049978)], [(161.293477, 61.949978), (161.293477, 100.51757)], [(73.138981, 61.949978), (73.138981, 100.51757), (161.293477, 100.51757)], [(73.138981, 61.949978), (161.293477, 61.949978)], [(213.861069, 114.51757), (175.293477, 114.51757), (175.293477, 172.049978)], [(213.861069, 172.049978), (175.293477, 172.049978)], [(213.861069, 114.51757), (213.861069, 172.049978)]])\nVISIBLE_CIRCLES = [(117.6802, 146.0676, 10.207363)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(127.8875, 61.95, 127.8875, 100.5176), (107.4728, 100.5176, 107.4728, 61.95), (175.2935, 135.8603, 213.861, 135.8603), (175.2935, 156.275, 213.861, 156.275)]\nDIMENSIONS = [('horizontal', '100', (161.2935, 114.5176), (73.139, 114.5176), (117.2162, 103.5176)), ('vertical', '65.2632', (161.2935, 172.05), (161.2935, 114.5176), (172.2935, 143.2838)), ('diameter', '%%c23.1579', (117.6802, 146.0676), 10.2074, 45), ('horizontal', '50.5263', (73.139, 146.0676), (117.6802, 146.0676), (95.4096, 157.0676)), ('vertical', '29.4737', (117.6802, 172.05), (117.6802, 146.0676), (128.6802, 159.0588)), ('horizontal', '43.75', (213.861, 172.05), (175.2935, 172.05), (194.5772, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0003_00032913_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0004_00041275","images":["images/0004_00041275.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges, featuring a circular hole of diameter 117.88 mm. It is extruded to a thickness of 102.11 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3498188868521813\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(101.335977, 111.670224), (135.943884, 111.670224), (153.616007, 141.8601), (135.943884, 172.049976), (101.335977, 172.049976), (83.663855, 141.8601), (101.335977, 111.670224)], [(101.335977, 97.670224), (101.335977, 61.949976), (135.943884, 61.949976)], [(135.943884, 97.670224), (135.943884, 61.949976)], [(101.335977, 97.670224), (135.943884, 97.670224)], [(135.943884, 61.949976), (153.616007, 61.949976)], [(153.616007, 97.670224), (153.616007, 61.949976)], [(135.943884, 97.670224), (153.616007, 97.670224)], [(83.663855, 97.670224), (83.663855, 61.949976), (101.335977, 61.949976)], [(83.663855, 97.670224), (101.335977, 97.670224)], [(203.336255, 111.670224), (167.616007, 111.670224)], [(203.336255, 172.049976), (167.616007, 172.049976), (167.616007, 141.8601)], [(203.336255, 141.8601), (167.616007, 141.8601)], [(203.336255, 172.049976), (203.336255, 141.8601)], [(167.616007, 141.8601), (167.616007, 111.670224)], [(203.336255, 141.8601), (203.336255, 111.670224)]])\nVISIBLE_CIRCLES = [(119.0081, 141.8601, 20.617476)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(139.6255, 61.95, 139.6255, 97.6702), (98.3906, 97.6702, 98.3906, 61.95), (167.616, 121.2426, 203.3362, 121.2426), (167.616, 162.4776, 203.3362, 162.4776)]\nDIMENSIONS = [('horizontal', '98.9309', (101.3359, 172.05), (135.9438, 172.05), (118.6399, 183.05)), ('aligned', '100', (135.9438, 172.05), (153.616, 141.8601), (154.2731, 162.512)), ('aligned', '100', (153.616, 141.8601), (135.9438, 111.6703), (154.2731, 121.2082)), ('aligned', '100', (101.3359, 111.6703), (83.6638, 141.8601), (83.0067, 121.2082)), ('aligned', '100', (83.6638, 141.8601), (101.3359, 172.05), (83.0067, 162.512)), ('diameter', '%%c117.875', (119.0081, 141.8601), 20.6175, 45), ('horizontal', '101.036', (83.6638, 141.8601), (119.0081, 141.8601), (101.3359, 152.8601)), ('vertical', '86.3014', (119.0081, 172.05), (119.0081, 141.8601), (130.0081, 156.9551)), ('horizontal', '102.111', (203.3362, 172.05), (167.6159, 172.05), (185.4761, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0004_00041275_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0008_00089196","images":["images/0008_00089196.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm, featuring a circular hole of diameter 80 mm. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3203333333333344\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(120.48327, 172.049963), (120.48327, 140.01663)], [(88.449937, 172.049963), (120.48327, 172.049963)], [(120.48327, 140.01663), (88.449937, 140.01663), (88.449937, 172.049963)], [(120.48327, 126.01663), (120.48327, 61.949963)], [(88.449937, 126.01663), (88.449937, 61.949963)], [(88.449937, 126.01663), (120.48327, 126.01663)], [(88.449937, 61.949963), (120.48327, 61.949963)], [(134.48327, 172.049963), (198.549937, 172.049963)], [(198.549937, 140.01663), (134.48327, 140.01663), (134.48327, 172.049963)], [(198.549937, 140.01663), (198.549937, 172.049963)]])\nVISIBLE_CIRCLES = [(104.6352, 155.8647, 12.813333)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(117.4486, 126.0167, 117.4486, 61.95), (91.8219, 126.0167, 91.8219, 61.95), (134.4833, 143.0514, 198.55, 143.0514), (134.4833, 168.6781, 198.55, 168.6781)]\nDIMENSIONS = [('horizontal', '100', (120.4833, 140.0167), (88.45, 140.0167), (104.4667, 129.0167)), ('vertical', '100', (120.4833, 172.05), (120.4833, 140.0167), (131.4833, 156.0333)), ('diameter', '%%c80', (104.6352, 155.8647), 12.8133, 45), ('horizontal', '50.5263', (88.45, 155.8647), (104.6352, 155.8647), (96.5426, 166.8647)), ('vertical', '50.5263', (104.6352, 172.05), (104.6352, 155.8647), (115.6352, 163.9574)), ('horizontal', '200', (198.55, 172.05), (134.4833, 172.05), (166.5167, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0008_00089196_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0020_00207567","images":["images/0020_00207567.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges, featuring a circular hole of diameter 246.15 mm. It is extruded to a thickness of 1299.15 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.062188606194702546\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(98.774901, 170.854113), (92.556041, 170.854113)], [(101.804603, 165.592), (98.774901, 170.854113)], [(98.774901, 160.329887), (101.804603, 165.592)], [(92.556041, 160.329887), (98.774901, 160.329887)], [(89.526339, 165.592), (92.556041, 160.329887)], [(92.556041, 170.854113), (89.526339, 165.592)], [(88.091218, 143.938017), (88.569592, 143.938017), (89.047965, 143.938017), (89.526339, 143.938017), (90.004713, 143.938017), (90.483087, 143.938017), (90.961461, 143.938017), (91.439835, 143.938017), (91.918209, 143.938017), (92.396583, 143.938017), (92.874957, 143.938017), (93.353331, 143.938017), (93.831704, 143.938017), (94.310078, 143.938017), (94.788452, 143.938017), (95.266826, 143.938017), (95.7452, 143.938017), (96.223574, 143.938017), (96.701948, 143.938017), (97.180322, 143.938017), (97.658696, 143.938017), (98.137069, 143.938017), (98.615443, 143.938017), (99.093817, 143.938017), (99.572191, 143.938017), (100.050565, 143.938017), (100.528939, 143.938017), (101.007313, 143.938017), (101.485687, 143.938017), (101.964061, 143.938017), (102.442435, 143.938017), (102.920808, 143.938017), (103.399182, 143.938017), (103.399182, 63.145982)], [(88.091218, 63.145982), (88.569592, 63.145982), (89.047965, 63.145982), (89.526339, 63.145982), (90.004713, 63.145982), (90.483087, 63.145982), (90.961461, 63.145982), (91.439835, 63.145982), (91.918209, 63.145982), (92.396583, 63.145982), (92.874957, 63.145982), (93.353331, 63.145982), (93.831704, 63.145982), (94.310078, 63.145982), (94.788452, 63.145982), (95.266826, 63.145982), (95.7452, 63.145982), (96.223574, 63.145982), (96.701948, 63.145982), (97.180322, 63.145982), (97.658696, 63.145982), (98.137069, 63.145982), (98.615443, 63.145982), (99.093817, 63.145982), (99.572191, 63.145982), (100.050565, 63.145982), (100.528939, 63.145982), (101.007313, 63.145982), (101.485687, 63.145982), (101.964061, 63.145982), (102.442435, 63.145982), (102.920808, 63.145982), (103.399182, 63.145982)], [(88.091218, 63.145982), (88.091218, 143.938017)], [(198.191218, 173.245982), (198.191218, 172.767608), (198.191218, 172.289235), (198.191218, 171.810861), (198.191218, 171.332487), (198.191218, 170.854113), (198.191218, 170.375739), (198.191218, 169.897365), (198.191218, 169.418991), (198.191218, 168.940617), (198.191218, 168.462243), (198.191218, 167.983869), (198.191218, 167.505496), (198.191218, 167.027122), (198.191218, 166.548748), (198.191218, 166.070374), (198.191218, 165.592), (198.191218, 165.113626), (198.191218, 164.635252), (198.191218, 164.156878), (198.191218, 163.678504), (198.191218, 163.200131), (198.191218, 162.721757), (198.191218, 162.243383), (198.191218, 161.765009), (198.191218, 161.286635), (198.191218, 160.808261), (198.191218, 160.329887), (198.191218, 159.851513), (198.191218, 159.373139), (198.191218, 158.894765), (198.191218, 158.416392), (198.191218, 157.938018)], [(117.399183, 173.245982), (117.399183, 172.767608), (117.399183, 172.289235), (117.399183, 171.810861), (117.399183, 171.332487), (117.399183, 170.854113), (117.399183, 170.375739), (117.399183, 169.897365), (117.399183, 169.418991), (117.399183, 168.940617), (117.399183, 168.462243), (117.399183, 167.983869), (117.399183, 167.505496), (117.399183, 167.027122), (117.399183, 166.548748), (117.399183, 166.070374), (117.399183, 165.592), (117.399183, 165.113626), (117.399183, 164.635252), (117.399183, 164.156878), (117.399183, 163.678504), (117.399183, 163.200131), (117.399183, 162.721757), (117.399183, 162.243383), (117.399183, 161.765009), (117.399183, 161.286635), (117.399183, 160.808261), (117.399183, 160.329887), (117.399183, 159.851513), (117.399183, 159.373139), (117.399183, 158.894765), (117.399183, 158.416392), (117.399183, 157.938018)], [(117.399183, 173.245982), (198.191218, 173.245982)], [(117.399183, 157.938018), (198.191218, 157.938018)]])\nVISIBLE_CIRCLES = [(95.7452, 165.592, 7.653982)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(98.7749, 63.1459, 98.7749, 143.938), (92.556, 63.1459, 92.556, 143.938), (101.8046, 63.1459, 101.8046, 143.938), (89.5263, 63.1459, 89.5263, 143.938), (198.1912, 160.3298, 117.3992, 160.3298), (198.1912, 165.592, 117.3992, 165.592), (198.1912, 170.8541, 117.3992, 170.8541)]\nDIMENSIONS = [('horizontal', '100', (92.556, 170.8541), (98.7749, 170.8541), (95.6655, 181.8541)), ('aligned', '97.6381', (98.7749, 170.8541), (101.8046, 165.592), (109.8226, 173.7116)), ('aligned', '97.6381', (101.8046, 165.592), (98.7749, 160.3298), (109.8226, 157.4723)), ('aligned', '97.6381', (92.556, 160.3298), (89.5263, 165.592), (81.5083, 157.4723)), ('aligned', '97.6381', (89.5263, 165.592), (92.556, 170.8541), (81.5083, 173.7116)), ('diameter', '%%c246.154', (95.7452, 165.592), 7.654, 45), ('horizontal', '100', (89.5263, 165.592), (95.7452, 165.592), (92.6358, 176.592)), ('vertical', '84.6154', (95.7452, 170.8541), (95.7452, 165.592), (106.7452, 168.223)), ('horizontal', '1299.15', (198.1912, 170.8541), (117.3992, 170.8541), (157.7952, 159.8541))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0020_00207567_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0027_00277180","images":["images/0027_00277180.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 27.37 mm tall, featuring a circular hole of diameter 8.42 mm. It is extruded to a thickness of 5.21 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1536611570248256\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(191.178721, 111.217358), (191.178721, 142.791242), (75.812606, 142.791242), (75.812606, 111.217358), (191.178721, 111.217358)], [(191.178721, 97.217358), (191.178721, 91.208706)], [(75.812606, 97.217358), (75.812606, 91.208706), (191.178721, 91.208706)], [(75.812606, 97.217358), (191.178721, 97.217358)], [(211.187373, 142.791242), (205.178721, 142.791242), (205.178721, 111.217358)], [(211.187373, 111.217358), (205.178721, 111.217358)], [(211.187373, 142.791242), (211.187373, 111.217358)]])\nVISIBLE_CIRCLES = [(180.2493, 127.0043, 4.857521)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(185.1068, 91.2087, 185.1068, 97.2174), (175.3918, 97.2174, 175.3918, 91.2087), (205.1787, 122.1468, 211.1874, 122.1468), (205.1787, 131.8618, 211.1874, 131.8618)]\nDIMENSIONS = [('horizontal', '100', (191.1787, 111.2174), (75.8126, 111.2174), (133.4957, 100.2174)), ('vertical', '27.3684', (191.1787, 142.7912), (191.1787, 111.2174), (202.1787, 127.0043)), ('diameter', '%%c8.4211', (180.2493, 127.0043), 4.8575, 45), ('horizontal', '90.5263', (75.8126, 127.0043), (180.2493, 127.0043), (128.031, 138.0043)), ('vertical', '13.6842', (180.2493, 142.7912), (180.2493, 127.0043), (191.2493, 134.8978)), ('horizontal', '5.2083', (211.1874, 142.7912), (205.1788, 142.7912), (208.1831, 131.7912))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0027_00277180_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0028_00287052","images":["images/0028_00287052.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 35.79 mm tall, featuring a circular hole of diameter 23.16 mm. It is extruded to a thickness of 58.9 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9247575289575778\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(155.505762, 167.780393), (155.505762, 134.683807), (63.030009, 134.683807), (63.030009, 167.780393), (155.505762, 167.780393)], [(155.505762, 66.21956), (155.505762, 120.683807), (63.030009, 120.683807)], [(63.030009, 66.21956), (63.030009, 120.683807)], [(155.505762, 66.21956), (63.030009, 66.21956)], [(169.505762, 134.683807), (223.970009, 134.683807), (223.970009, 167.780393)], [(169.505762, 167.780393), (223.970009, 167.780393)], [(169.505762, 134.683807), (169.505762, 167.780393)]])\nVISIBLE_CIRCLES = [(109.7546, 151.2321, 10.707719)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(120.4623, 120.6838, 120.4623, 66.2196), (99.0469, 66.2196, 99.0469, 120.6838), (223.97, 161.9398, 169.5058, 161.9398), (223.97, 140.5244, 169.5058, 140.5244)]\nDIMENSIONS = [('horizontal', '100', (155.5058, 167.7805), (63.03, 167.7805), (109.2679, 156.7805)), ('vertical', '35.7895', (155.5058, 134.6838), (155.5058, 167.7805), (144.5058, 151.2321)), ('diameter', '%%c23.1579', (109.7546, 151.2321), 10.7077, 45), ('horizontal', '50.5263', (63.03, 151.2321), (109.7546, 151.2321), (86.3923, 162.2321)), ('vertical', '17.8947', (109.7546, 134.6838), (109.7546, 151.2321), (98.7546, 142.958)), ('horizontal', '58.8957', (169.5058, 134.6838), (223.97, 134.6838), (196.7379, 145.6838))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0028_00287052_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00528733","images":["images/0052_00528733.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm, featuring a circular hole of diameter 21.05 mm. It is extruded to a thickness of -19.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8022260869565664\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(168.67258, 91.827371), (168.67258, 172.04998), (88.449971, 172.04998), (88.449971, 91.827371), (168.67258, 91.827371)], [(168.67258, 61.94998), (168.67258, 77.827371), (88.449971, 77.827371)], [(88.449971, 61.94998), (88.449971, 77.827371)], [(168.67258, 61.94998), (88.449971, 61.94998)], [(198.549971, 172.04998), (182.67258, 172.04998), (182.67258, 91.827371)], [(198.549971, 91.827371), (182.67258, 91.827371)], [(198.549971, 172.04998), (198.549971, 91.827371)]])\nVISIBLE_CIRCLES = [(128.9835, 132.3609, 8.444485)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(137.428, 61.95, 137.428, 77.8274), (120.539, 77.8274, 120.539, 61.95), (182.6726, 123.9164, 198.55, 123.9164), (182.6726, 140.8054, 198.55, 140.8054)]\nDIMENSIONS = [('horizontal', '100', (168.6726, 172.05), (88.45, 172.05), (128.5613, 161.05)), ('vertical', '100', (168.6726, 91.8274), (168.6726, 172.05), (157.6726, 131.9387)), ('diameter', '%%c21.0526', (128.9835, 132.3609), 8.4445, 45), ('horizontal', '50.5263', (88.45, 132.3609), (128.9835, 132.3609), (108.7168, 143.3609)), ('vertical', '50.5263', (128.9835, 91.8274), (128.9835, 132.3609), (117.9835, 112.0941)), ('horizontal', '19.7917', (198.55, 91.8274), (182.6726, 91.8274), (190.6113, 80.8274))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00528733_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00669439","images":["images/0066_00669439.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges, featuring a circular hole of diameter 114.98 mm. It is extruded to a thickness of 57.91 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3847551429155767\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(113.1148, 171.0852), (150.2448, 163.9752), (162.8848, 127.6352), (137.6048, 99.1952), (100.4748, 106.3052), (87.8348, 142.6452), (113.1148, 171.0852)], [(113.1148, 62.914731), (113.1148, 85.1952), (150.2448, 85.1952)], [(150.2448, 62.914731), (150.2448, 85.1952)], [(113.1148, 62.914731), (150.2448, 62.914731)], [(150.2448, 85.1952), (162.8848, 85.1952)], [(162.8848, 62.914731), (162.8848, 85.1952)], [(150.2448, 62.914731), (162.8848, 62.914731)], [(87.8348, 62.914731), (87.8348, 85.1952), (113.1148, 85.1952)], [(87.8348, 62.914731), (113.1148, 62.914731)], [(199.165269, 171.0852), (176.8848, 171.0852)], [(199.165269, 99.1952), (176.8848, 99.1952), (176.8848, 106.3052)], [(199.165269, 106.3052), (176.8848, 106.3052)], [(199.165269, 99.1952), (199.165269, 106.3052)], [(176.8848, 106.3052), (176.8848, 142.6452)], [(199.165269, 142.6452), (176.8848, 142.6452)], [(199.165269, 106.3052), (199.165269, 142.6452)], [(176.8848, 142.6452), (176.8848, 171.0852)], [(199.165269, 142.6452), (199.165269, 171.0852)]])\nVISIBLE_CIRCLES = [(125.7548, 135.5352, 22.12)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(137.6048, 62.9148, 137.6048, 85.1952), (100.4748, 62.9148, 100.4748, 85.1952), (147.8748, 62.9148, 147.8748, 85.1952), (103.6348, 85.1952, 103.6348, 62.9148), (199.1652, 163.9752, 176.8848, 163.9752), (199.1652, 127.6352, 176.8848, 127.6352), (176.8848, 113.4152, 199.1652, 113.4152), (176.8848, 157.6552, 199.1652, 157.6552)]\nDIMENSIONS = [('aligned', '98.2563', (113.1148, 171.0852), (150.2448, 163.9752), (133.7486, 178.334)), ('aligned', '100', (150.2448, 163.9752), (162.8848, 127.6352), (166.9542, 149.419)), ('aligned', '98.8978', (162.8848, 127.6352), (137.6048, 99.1952), (158.4663, 106.1072)), ('aligned', '98.2563', (137.6048, 99.1952), (100.4748, 106.3052), (116.971, 91.9465)), ('aligned', '100', (100.4748, 106.3052), (87.8348, 142.6452), (83.7653, 120.8615)), ('aligned', '98.8978', (87.8348, 142.6452), (113.1148, 171.0852), (92.2533, 164.1732)), ('diameter', '%%c114.982', (125.7548, 135.5352), 22.12, 45), ('horizontal', '98.5562', (87.8348, 135.5352), (125.7548, 135.5352), (106.7948, 146.5352)), ('vertical', '92.3964', (125.7548, 171.0852), (125.7548, 135.5352), (136.7548, 153.3102)), ('horizontal', '57.9082', (199.1652, 171.0852), (176.8848, 171.0852), (188.025, 160.0852))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00669439_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0075_00759701","images":["images/0075_00759701.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 54.74 mm tall, featuring a circular hole of diameter 21.05 mm. It is extruded to a thickness of 8.85 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6210544217687202\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.053763, 146.496179), (162.053763, 112.501621)], [(99.948321, 146.496179), (162.053763, 146.496179)], [(162.053763, 112.501621), (99.948321, 112.501621), (99.948321, 146.496179)], [(162.053763, 87.503782), (162.053763, 98.501621), (99.948321, 98.501621)], [(99.948321, 87.503782), (99.948321, 98.501621)], [(162.053763, 87.503782), (99.948321, 87.503782)], [(187.051602, 146.496179), (176.053763, 146.496179)], [(176.053763, 112.501621), (187.051602, 112.501621), (187.051602, 146.496179)], [(176.053763, 112.501621), (176.053763, 146.496179)]])\nVISIBLE_CIRCLES = [(116.9456, 129.4989, 6.537415)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(123.4831, 87.5038, 123.4831, 98.5016), (110.4082, 87.5038, 110.4082, 98.5016), (187.0516, 136.0363, 176.0538, 136.0363), (187.0516, 122.9615, 176.0538, 122.9615)]\nDIMENSIONS = [('horizontal', '100', (162.0538, 146.4962), (99.9484, 146.4962), (131.0011, 135.4962)), ('vertical', '54.7368', (162.0538, 112.5017), (162.0538, 146.4962), (151.0538, 129.4989)), ('diameter', '%%c21.0526', (116.9456, 129.4989), 6.5374, 45), ('horizontal', '27.3684', (99.9484, 129.4989), (116.9456, 129.4989), (108.447, 140.4989)), ('vertical', '27.3684', (116.9456, 112.5017), (116.9456, 129.4989), (105.9456, 121.0003)), ('horizontal', '17.7083', (176.0538, 112.5017), (187.0517, 112.5017), (181.5527, 123.5017))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0075_00759701_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0088_00888193","images":["images/0088_00888193.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm, featuring a circular hole of diameter 88.42 mm. It is extruded to a thickness of 4.17 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7346999999999999\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(170.173716, 163.796284), (170.173716, 90.326284)], [(96.703716, 163.796284), (170.173716, 163.796284)], [(170.173716, 90.326284), (96.703716, 90.326284), (96.703716, 163.796284)], [(170.173716, 76.326284), (170.173716, 70.203784)], [(96.703716, 76.326284), (96.703716, 70.203784)], [(96.703716, 76.326284), (170.173716, 76.326284)], [(96.703716, 70.203784), (170.173716, 70.203784)], [(184.173716, 163.796284), (190.296216, 163.796284)], [(190.296216, 90.326284), (184.173716, 90.326284), (184.173716, 163.796284)], [(190.296216, 90.326284), (190.296216, 163.796284)]])\nVISIBLE_CIRCLES = [(133.8254, 126.6746, 32.481474)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(166.3069, 76.3263, 166.3069, 70.2037), (101.344, 76.3263, 101.344, 70.2037), (184.1737, 94.1931, 190.2963, 94.1931), (184.1737, 159.156, 190.2963, 159.156)]\nDIMENSIONS = [('horizontal', '100', (170.1737, 90.3263), (96.7037, 90.3263), (133.4387, 79.3263)), ('vertical', '100', (170.1737, 163.7963), (170.1737, 90.3263), (181.1737, 127.0613)), ('diameter', '%%c88.4211', (133.8254, 126.6746), 32.4815, 45), ('horizontal', '50.5263', (96.7037, 126.6746), (133.8254, 126.6746), (115.2646, 137.6746)), ('vertical', '50.5263', (133.8254, 163.7963), (133.8254, 126.6746), (144.8254, 145.2354)), ('horizontal', '8.3333', (190.2963, 163.7963), (184.1737, 163.7963), (187.235, 152.7963))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0088_00888193_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0091_00918490","images":["images/0091_00918490.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 33.68 mm wide and 100 mm tall, featuring 2 circular holes, each of diameter 4.21 mm. It is extruded to a thickness of 2.6 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9366091370558345\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(151.054922, 78.389021), (151.054922, 172.049935), (119.505983, 172.049935), (119.505983, 78.389021), (151.054922, 78.389021)], [(151.054922, 64.389021), (151.054922, 61.949935), (119.505983, 61.949935)], [(119.505983, 64.389021), (119.505983, 61.949935)], [(151.054922, 64.389021), (119.505983, 64.389021)], [(165.054922, 172.049935), (167.494008, 172.049935), (167.494008, 78.389021)], [(165.054922, 78.389021), (167.494008, 78.389021)], [(165.054922, 172.049935), (165.054922, 78.389021)]])\nVISIBLE_CIRCLES = [(124.435504, 164.1627, 1.971809), (145.139496, 164.1627, 1.971809)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(126.4073, 64.3891, 126.4073, 61.95), (147.1113, 64.3891, 147.1113, 61.95), (122.4637, 61.95, 122.4637, 64.3891), (143.1677, 61.95, 143.1677, 64.3891), (167.494, 166.1346, 165.0549, 166.1346), (167.494, 162.191, 165.0549, 162.191)]\nDIMENSIONS = [('horizontal', '33.6842', (151.0549, 172.05), (119.506, 172.05), (135.2804, 161.05)), ('vertical', '100', (151.0549, 78.3891), (151.0549, 172.05), (140.0549, 125.2195)), ('diameter', '%%c4.2105', (124.4355, 164.1627), 1.9718, 45), ('horizontal', '5.2632', (119.506, 164.1627), (124.4355, 164.1627), (121.9707, 175.1627)), ('vertical', '91.5789', (124.4355, 78.3891), (124.4355, 164.1627), (113.4355, 121.2759)), ('diameter', '%%c4.2105', (145.1395, 164.1627), 1.9718, 45), ('horizontal', '27.3684', (119.506, 164.1627), (145.1395, 164.1627), (132.3227, 175.1627)), ('vertical', '91.5789', (145.1395, 78.3891), (145.1395, 164.1627), (134.1395, 121.2759)), ('horizontal', '2.6042', (165.0549, 78.3891), (167.494, 78.3891), (166.2745, 89.3891))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0091_00918490_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0099_00992542","images":["images/0099_00992542.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 33.68 mm tall, featuring 3 circular holes, each of diameter 23.16 mm. It is extruded to a thickness of 3.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4248727272727273\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(205.517225, 150.224256), (205.517225, 102.228544), (63.029953, 102.228544), (63.029953, 150.224256), (205.517225, 150.224256)], [(205.517225, 83.775816), (205.517225, 88.228544), (63.029953, 88.228544)], [(63.029953, 83.775816), (63.029953, 88.228544)], [(205.517225, 83.775816), (63.029953, 83.775816)], [(219.517225, 102.228544), (223.969953, 102.228544), (223.969953, 150.224256)], [(219.517225, 150.224256), (223.969953, 150.224256)], [(219.517225, 102.228544), (219.517225, 150.224256)]])\nVISIBLE_CIRCLES = [(87.027809, 126.2264, 16.498526), (135.023522, 126.2264, 16.498526), (181.519369, 126.2264, 16.498526)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(103.5264, 88.2285, 103.5264, 83.7758), (151.5221, 88.2285, 151.5221, 83.7758), (198.0179, 88.2285, 198.0179, 83.7758), (70.5293, 83.7758, 70.5293, 88.2285), (118.525, 83.7758, 118.525, 88.2285), (165.0209, 83.7758, 165.0209, 88.2285), (223.97, 142.7249, 219.5173, 142.7249), (223.97, 109.7278, 219.5173, 109.7278)]\nDIMENSIONS = [('horizontal', '100', (205.5173, 150.2242), (63.03, 150.2242), (134.2736, 139.2242)), ('vertical', '33.6842', (205.5173, 102.2285), (205.5173, 150.2242), (194.5173, 126.2264)), ('diameter', '%%c23.1579', (87.0278, 126.2264), 16.4985, 45), ('horizontal', '16.8421', (63.03, 126.2264), (87.0278, 126.2264), (75.0289, 137.2264)), ('vertical', '16.8421', (87.0278, 102.2285), (87.0278, 126.2264), (76.0278, 114.2274)), ('diameter', '%%c23.1579', (135.0235, 126.2264), 16.4985, 45), ('horizontal', '50.5263', (63.03, 126.2264), (135.0235, 126.2264), (99.0268, 137.2264)), ('vertical', '16.8421', (135.0235, 102.2285), (135.0235, 126.2264), (124.0235, 114.2274)), ('diameter', '%%c23.1579', (181.5194, 126.2264), 16.4985, 45), ('horizontal', '83.1579', (63.03, 126.2264), (181.5194, 126.2264), (122.2747, 137.2264)), ('vertical', '16.8421', (181.5194, 102.2285), (181.5194, 126.2264), (170.5194, 114.2274)), ('horizontal', '3.125', (219.5173, 102.2285), (223.97, 102.2285), (221.7436, 113.2285))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0099_00992542_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0013_00134043","images":["images/0013_00134043.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 4 straight edges, featuring a rectangular cutout 36.84 x 36.84 mm. It is extruded to a thickness of 31.43 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7312361605062593\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(89.219701, 98.93047), (161.569587, 98.93047), (161.569587, 171.280356), (88.450021, 172.050035), (89.219701, 98.93047)], [(138.479198, 148.189967), (111.54041, 148.959646)], [(138.479198, 122.020859), (138.479198, 148.189967)], [(111.54041, 122.020859), (138.479198, 122.020859)], [(111.54041, 148.959646), (111.54041, 122.020859)], [(161.569587, 84.93047), (161.569587, 61.950035), (88.450021, 61.950035)], [(88.450021, 84.93047), (88.450021, 61.950035)], [(161.569587, 84.93047), (88.450021, 84.93047)], [(175.569587, 98.93047), (198.550021, 98.93047)], [(175.569587, 172.050035), (198.550021, 172.050035), (198.550021, 98.93047)], [(175.569587, 172.050035), (175.569587, 98.93047)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(89.2197, 84.9304, 89.2197, 61.95), (138.4792, 84.9304, 138.4792, 61.95), (111.5404, 84.9304, 111.5404, 61.95), (175.5696, 171.2803, 198.55, 171.2803), (175.5696, 148.1899, 198.55, 148.1899), (175.5696, 148.9596, 198.55, 148.9596), (175.5696, 122.0208, 198.55, 122.0208)]\nDIMENSIONS = [('horizontal', '98.9419', (89.2197, 98.9305), (161.5696, 98.9305), (125.3946, 109.9305)), ('vertical', '98.9419', (161.5696, 98.9305), (161.5696, 171.2804), (150.5696, 135.1054)), ('aligned', '100', (161.5696, 171.2804), (88.45, 172.05), (124.894, 160.6658)), ('aligned', '100', (88.45, 172.05), (89.2197, 98.9305), (99.8342, 135.606)), ('horizontal', '36.8401', (111.5404, 122.0208), (138.4792, 122.0208), (125.0098, 133.0208)), ('vertical', '36.8401', (111.5404, 122.0208), (111.5404, 148.9596), (100.5404, 135.4902)), ('horizontal', '31.5772', (88.45, 122.0208), (111.5404, 122.0208), (99.9952, 133.0208)), ('vertical', '31.5772', (111.5404, 98.9305), (111.5404, 122.0208), (100.5404, 110.4757)), ('horizontal', '31.4268', (175.5696, 98.9305), (198.55, 98.9305), (187.0598, 109.9305))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0013_00134043_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0042_00422649","images":["images/0042_00422649.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges, featuring a rectangular cutout 187.34 x 164.18 mm. It is extruded to a thickness of 39.58 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3943960427256723\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(109.186538, 165.8414), (148.204504, 165.8414), (168.128571, 199.878349), (148.204504, 233.915298), (109.186538, 233.915298), (89.26247, 199.878349), (109.186538, 165.8414)], [(147.374334, 232.254959), (110.016707, 232.254959)], [(165.638063, 199.878349), (147.374334, 232.254959)], [(147.374334, 167.501739), (165.638063, 199.878349)], [(110.016707, 167.501739), (147.374334, 167.501739)], [(91.752978, 199.878349), (110.016707, 167.501739)], [(110.016707, 232.254959), (91.752978, 199.878349)], [(109.186538, 151.8414), (109.186538, 136.232484), (148.204504, 136.232484)], [(148.204504, 151.8414), (148.204504, 136.232484)], [(109.186538, 151.8414), (148.204504, 151.8414)], [(148.204504, 136.232484), (168.128571, 136.232484)], [(168.128571, 151.8414), (168.128571, 136.232484)], [(148.204504, 151.8414), (168.128571, 151.8414)], [(89.26247, 151.8414), (89.26247, 136.232484), (109.186538, 136.232484)], [(89.26247, 151.8414), (109.186538, 151.8414)], [(197.737487, 165.8414), (182.128571, 165.8414)], [(197.737487, 233.915298), (182.128571, 233.915298), (182.128571, 199.878349)], [(197.737487, 199.878349), (182.128571, 199.878349)], [(197.737487, 233.915298), (197.737487, 199.878349)], [(182.128571, 199.878349), (182.128571, 165.8414)], [(197.737487, 199.878349), (197.737487, 165.8414)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(147.3744, 68.1586, 147.3744, 83.7675), (110.0167, 68.1586, 110.0167, 83.7675), (165.6381, 68.1586, 165.6381, 83.7675), (91.753, 68.1586, 91.753, 83.7675), (197.7375, 99.4278, 182.1286, 99.4278), (197.7375, 164.1811, 182.1286, 164.1811)]\nDIMENSIONS = [('horizontal', '98.9309', (109.1865, 165.8414), (148.2045, 165.8414), (128.6955, 176.8414)), ('aligned', '100', (148.2045, 165.8414), (168.1286, 131.8045), (167.6597, 154.3799)), ('aligned', '100', (168.1286, 131.8045), (148.2045, 97.7675), (167.6597, 109.229)), ('aligned', '100', (109.1865, 97.7675), (89.2625, 131.8045), (89.7314, 109.229)), ('aligned', '100', (89.2625, 131.8045), (109.1865, 165.8414), (89.7314, 154.3799)), ('horizontal', '187.337', (91.753, 164.1811), (165.6381, 164.1811), (128.6955, 175.1811)), ('vertical', '164.183', (91.753, 164.1811), (91.753, 99.4279), (102.753, 131.8045)), ('horizontal', '6.3147', (89.2625, 164.1811), (91.753, 164.1811), (90.5078, 175.1811)), ('vertical', '4.2098', (91.753, 165.8414), (91.753, 164.1811), (102.753, 165.0112)), ('horizontal', '39.5768', (197.7375, 165.8414), (182.1286, 165.8414), (189.933, 154.8414))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0042_00422649_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0051_00519567","images":["images/0051_00519567.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 55.79 mm tall, featuring 2 polygonal cutouts. It is extruded to a thickness of 1.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4453114754099308\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(207.561108, 84.887779), (207.561108, 165.520946), (63.02996, 165.520946), (63.02996, 84.887779), (207.561108, 84.887779)], [(67.594102, 157.914043), (67.594102, 89.451921)], [(87.372048, 157.914043), (67.594102, 157.914043)], [(87.372048, 89.451921), (87.372048, 157.914043)], [(67.594102, 89.451921), (87.372048, 89.451921)], [(183.21902, 157.914043), (183.21902, 89.451921)], [(202.996966, 157.914043), (183.21902, 157.914043)], [(202.996966, 89.451921), (202.996966, 157.914043)], [(183.21902, 89.451921), (202.996966, 89.451921)], [(207.561108, 70.887779), (207.561108, 68.478927), (63.02996, 68.478927)], [(63.02996, 70.887779), (63.02996, 68.478927)], [(207.561108, 70.887779), (63.02996, 70.887779)], [(221.561108, 165.520946), (223.96996, 165.520946), (223.96996, 84.887779)], [(221.561108, 84.887779), (223.96996, 84.887779)], [(221.561108, 165.520946), (221.561108, 84.887779)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(67.5941, 70.8878, 67.5941, 68.479), (87.3721, 70.8878, 87.3721, 68.479), (183.2191, 70.8878, 183.2191, 68.479), (202.997, 70.8878, 202.997, 68.479), (221.5611, 157.9141, 223.97, 157.9141), (221.5611, 89.452, 223.97, 89.452)]\nDIMENSIONS = [('horizontal', '100', (207.5611, 165.521), (63.03, 165.521), (135.2955, 154.521)), ('vertical', '55.7895', (207.5611, 84.8878), (207.5611, 165.521), (196.5611, 125.2044)), ('horizontal', '13.6842', (67.5941, 89.4519), (87.372, 89.4519), (77.4831, 100.4519)), ('vertical', '47.3684', (67.5941, 89.4519), (67.5941, 157.914), (56.5941, 123.683)), ('horizontal', '3.1579', (63.03, 89.4519), (67.5941, 89.4519), (65.312, 100.4519)), ('vertical', '3.1579', (67.5941, 84.8878), (67.5941, 89.4519), (56.5941, 87.1699)), ('horizontal', '13.6842', (183.219, 89.4519), (202.997, 89.4519), (193.108, 100.4519)), ('vertical', '47.3684', (183.219, 89.4519), (183.219, 157.914), (172.219, 123.683)), ('horizontal', '83.1579', (63.03, 89.4519), (183.219, 89.4519), (123.1245, 100.4519)), ('vertical', '3.1579', (183.219, 84.8878), (183.219, 89.4519), (172.219, 87.1699)), ('horizontal', '1.6667', (221.5611, 84.8878), (223.97, 84.8878), (222.7656, 95.8878))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0051_00519567_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0060_00606743","images":["images/0060_00606743.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 42.11 mm wide and 100 mm tall, featuring 2 polygonal cutouts. It is extruded to a thickness of 2.6 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9366091370558345\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(154.998539, 172.050014), (154.998539, 78.389101), (115.562365, 78.389101), (115.562365, 172.050014), (154.998539, 172.050014)], [(125.421409, 94.16357), (125.421409, 156.275545)], [(130.35093, 94.16357), (125.421409, 94.16357)], [(130.35093, 156.275545), (130.35093, 94.16357)], [(125.421409, 156.275545), (130.35093, 156.275545)], [(140.209974, 94.16357), (140.209974, 156.275545)], [(145.139496, 94.16357), (140.209974, 94.16357)], [(145.139496, 156.275545), (145.139496, 94.16357)], [(140.209974, 156.275545), (145.139496, 156.275545)], [(154.998539, 61.950014), (154.998539, 64.389101), (115.562365, 64.389101)], [(115.562365, 61.950014), (115.562365, 64.389101)], [(154.998539, 61.950014), (115.562365, 61.950014)], [(168.998539, 78.389101), (171.437626, 78.389101), (171.437626, 172.050014)], [(168.998539, 172.050014), (171.437626, 172.050014)], [(168.998539, 78.389101), (168.998539, 172.050014)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(125.4214, 64.3891, 125.4214, 61.95), (130.3509, 64.3891, 130.3509, 61.95), (140.21, 64.3891, 140.21, 61.95), (145.1395, 64.3891, 145.1395, 61.95), (168.9985, 156.2755, 171.4376, 156.2755), (168.9985, 94.1636, 171.4376, 94.1636)]\nDIMENSIONS = [('horizontal', '42.1053', (154.9985, 172.05), (115.5624, 172.05), (135.2805, 161.05)), ('vertical', '100', (154.9985, 78.3891), (154.9985, 172.05), (143.9985, 125.2195)), ('horizontal', '5.2632', (125.4214, 94.1636), (130.3509, 94.1636), (127.8862, 105.1636)), ('vertical', '66.3158', (125.4214, 94.1636), (125.4214, 156.2755), (114.4214, 125.2195)), ('horizontal', '10.5263', (115.5624, 94.1636), (125.4214, 94.1636), (120.4919, 105.1636)), ('vertical', '16.8421', (125.4214, 78.3891), (125.4214, 94.1636), (114.4214, 86.2763)), ('horizontal', '5.2632', (140.21, 94.1636), (145.1395, 94.1636), (142.6748, 105.1636)), ('vertical', '66.3158', (140.21, 94.1636), (140.21, 156.2755), (129.21, 125.2195)), ('horizontal', '26.3158', (115.5624, 94.1636), (140.21, 94.1636), (127.8862, 105.1636)), ('vertical', '16.8421', (140.21, 78.3891), (140.21, 94.1636), (129.21, 86.2763)), ('horizontal', '2.6042', (168.9985, 78.3891), (171.4377, 78.3891), (170.2181, 89.3891))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0060_00606743_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00821605","images":["images/0082_00821605.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm, featuring a rectangular cutout 24.21 x 24.21 mm. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.48049999999999987\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.499997, 124.000003), (136.499997, 172.050003), (88.449997, 172.050003), (88.449997, 124.000003), (136.499997, 124.000003)], [(106.658418, 153.841582), (106.658418, 142.208424)], [(118.291576, 153.841582), (106.658418, 153.841582)], [(118.291576, 142.208424), (118.291576, 153.841582)], [(106.658418, 142.208424), (118.291576, 142.208424)], [(136.499997, 110.000003), (136.499997, 61.950003)], [(88.449997, 110.000003), (88.449997, 61.950003), (136.499997, 61.950003)], [(88.449997, 110.000003), (136.499997, 110.000003)], [(198.549997, 172.050003), (150.499997, 172.050003), (150.499997, 124.000003)], [(198.549997, 124.000003), (150.499997, 124.000003)], [(198.549997, 172.050003), (198.549997, 124.000003)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(106.6584, 61.95, 106.6584, 110.0), (118.2916, 61.95, 118.2916, 110.0), (198.55, 142.2084, 150.5, 142.2084), (198.55, 153.8416, 150.5, 153.8416)]\nDIMENSIONS = [('horizontal', '100', (136.5, 124.0), (88.45, 124.0), (112.475, 113.0)), ('vertical', '100', (136.5, 172.05), (136.5, 124.0), (147.5, 148.025)), ('horizontal', '24.2105', (106.6584, 153.8416), (118.2916, 153.8416), (112.475, 164.8416)), ('vertical', '24.2105', (106.6584, 153.8416), (106.6584, 142.2084), (117.6584, 148.025)), ('horizontal', '37.8947', (88.45, 153.8416), (106.6584, 153.8416), (97.5542, 164.8416)), ('vertical', '37.8947', (106.6584, 172.05), (106.6584, 153.8416), (117.6584, 162.9458)), ('horizontal', '100', (198.55, 172.05), (150.5, 172.05), (174.525, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00821605_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0092_00925947","images":["images/0092_00925947.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 91.58 mm tall, featuring a rectangular cutout 83.16 x 74.74 mm. It is extruded to a thickness of -7.14 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.76699450549487\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(172.110452, 91.618969), (172.110452, 161.859519), (95.411002, 161.859519), (95.411002, 91.618969), (172.110452, 91.618969)], [(101.869903, 155.400618), (101.869903, 98.07787)], [(165.651551, 155.400618), (101.869903, 155.400618)], [(165.651551, 98.07787), (165.651551, 155.400618)], [(101.869903, 98.07787), (165.651551, 98.07787)], [(172.110452, 72.140437), (172.110452, 77.618969)], [(95.411002, 72.140437), (95.411002, 77.618969), (172.110452, 77.618969)], [(95.411002, 72.140437), (172.110452, 72.140437)], [(186.110452, 161.859519), (191.588984, 161.859519), (191.588984, 91.618969)], [(186.110452, 91.618969), (191.588984, 91.618969)], [(186.110452, 161.859519), (186.110452, 91.618969)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(101.8699, 77.619, 101.8699, 72.1405), (165.6516, 77.619, 165.6516, 72.1405), (186.1105, 98.0779, 191.589, 98.0779), (186.1105, 155.4006, 191.589, 155.4006)]\nDIMENSIONS = [('horizontal', '100', (172.1104, 91.619), (95.411, 91.619), (133.7607, 80.619)), ('vertical', '91.5789', (172.1104, 161.8595), (172.1104, 91.619), (183.1104, 126.7393)), ('horizontal', '83.1579', (101.8699, 155.4006), (165.6516, 155.4006), (133.7607, 166.4006)), ('vertical', '74.7368', (101.8699, 155.4006), (101.8699, 98.0779), (112.8699, 126.7393)), ('horizontal', '8.4211', (95.411, 155.4006), (101.8699, 155.4006), (98.6404, 166.4006)), ('vertical', '8.4211', (101.8699, 161.8595), (101.8699, 155.4006), (112.8699, 158.6301)), ('horizontal', '7.1429', (186.1105, 161.8595), (191.589, 161.8595), (188.8497, 172.8595))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0092_00925947_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0003_00036532","images":["images/0003_00036532.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 100 x 85.26 mm bounding box. It is extruded to a thickness of -114.29 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.481586284853074\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(133.060088, 172.050002), (133.060088, 137.578562), (98.588649, 137.578562), (98.588649, 130.988434), (84.901459, 130.988434), (84.901459, 172.050002), (133.060088, 172.050002)], [(133.060088, 116.988434), (133.060088, 61.950002)], [(84.901459, 116.988434), (84.901459, 61.950002), (133.060088, 61.950002)], [(84.901459, 116.988434), (133.060088, 116.988434)], [(147.060088, 130.988434), (202.09852, 130.988434), (202.09852, 172.050002)], [(147.060088, 172.050002), (202.09852, 172.050002)], [(147.060088, 130.988434), (147.060088, 172.050002)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(98.5887, 116.9884, 98.5887, 61.95), (147.0601, 137.5786, 202.0985, 137.5786)]\nDIMENSIONS = [('vertical', '71.5789', (133.0601, 137.5786), (133.0601, 172.05), (122.0601, 154.8143)), ('horizontal', '71.5789', (98.5886, 137.5786), (133.0601, 137.5786), (115.8244, 148.5786)), ('vertical', '13.6842', (98.5886, 130.9884), (98.5886, 137.5786), (87.5886, 134.2835)), ('horizontal', '28.4211', (84.9015, 130.9884), (98.5886, 130.9884), (91.7451, 141.9884)), ('vertical', '85.2632', (84.9015, 172.05), (84.9015, 130.9884), (95.9015, 151.5192)), ('horizontal', '100', (133.0601, 172.05), (84.9015, 172.05), (108.9808, 161.05)), ('horizontal', '114.286', (147.0601, 172.05), (202.0985, 172.05), (174.5793, 183.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0003_00036532_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0006_00060240","images":["images/0006_00060240.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 70.53 x 100 mm bounding box. It is extruded to a thickness of 2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5635493827160484\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(150.446591, 96.409586), (150.446591, 103.528104), (155.78548, 103.528104), (155.78548, 152.764524), (116.040418, 152.764524), (116.040418, 96.409586), (150.446591, 96.409586)], [(155.78548, 82.409586), (155.78548, 81.235525), (116.040418, 81.235525)], [(116.040418, 82.409586), (116.040418, 81.235525)], [(155.78548, 82.409586), (116.040418, 82.409586)], [(169.78548, 152.764524), (170.959541, 152.764524), (170.959541, 96.409586)], [(169.78548, 96.409586), (170.959541, 96.409586)], [(169.78548, 152.764524), (169.78548, 96.409586)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(150.4466, 82.4096, 150.4466, 81.2355), (169.7855, 103.5281, 170.9596, 103.5281)]\nDIMENSIONS = [('vertical', '12.6316', (150.4466, 103.5281), (150.4466, 96.4096), (161.4466, 99.9688)), ('horizontal', '9.4737', (155.7855, 103.5281), (150.4466, 103.5281), (153.116, 92.5281)), ('vertical', '87.3684', (155.7855, 152.7645), (155.7855, 103.5281), (166.7855, 128.1463)), ('horizontal', '70.5263', (116.0404, 152.7645), (155.7855, 152.7645), (135.913, 163.7645)), ('vertical', '100', (116.0404, 96.4096), (116.0404, 152.7645), (105.0404, 124.587)), ('horizontal', '61.0526', (150.4466, 96.4096), (116.0404, 96.4096), (133.2435, 85.4096)), ('horizontal', '2.0833', (169.7855, 96.4096), (170.9595, 96.4096), (170.3725, 107.4096))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0006_00060240_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0007_00074919","images":["images/0007_00074919.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 10.2 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nSCALE = 0.8720185185185191\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = [(175.651876, 84.848116, 88.450024, 84.848116), (175.651876, 172.049968, 175.651876, 84.848116), (88.450024, 172.049968, 175.651876, 172.049968), (88.450024, 84.848116, 88.450024, 172.049968), (175.651876, 70.848116, 175.651876, 61.949968), (88.450024, 61.949968, 175.651876, 61.949968), (88.450024, 70.848116, 88.450024, 61.949968), (175.651876, 70.848116, 88.450024, 70.848116), (189.651876, 84.848116, 198.550024, 84.848116), (189.651876, 172.049968, 198.550024, 172.049968), (198.550024, 84.848116, 198.550024, 172.049968), (189.651876, 172.049968, 189.651876, 84.848116)]\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '100', (175.6519, 172.05), (175.6519, 84.8481), (186.6519, 128.4491)), ('horizontal', '100', (88.45, 172.05), (175.6519, 172.05), (132.0509, 183.05)), ('vertical', '100', (88.45, 84.8481), (88.45, 172.05), (77.45, 128.4491)), ('horizontal', '100', (175.6519, 84.8481), (88.45, 84.8481), (132.0509, 73.8481)), ('horizontal', '10.2041', (189.6519, 84.8481), (198.55, 84.8481), (194.1009, 95.8481))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0007_00074919_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0010_00100853","images":["images/0010_00100853.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 70.53 mm tall, featuring 3 circular holes, each of diameter 4.21 mm. It is extruded to a thickness of 7.81 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.226722653789733\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(193.044227, 85.53369), (193.044227, 172.04992), (70.371961, 172.04992)], [(70.371961, 85.53369), (70.371961, 172.04992)], [(70.371961, 85.53369), (193.044227, 85.53369)], [(193.044227, 71.53369), (193.044227, 61.94992), (70.371961, 61.94992)], [(70.371961, 71.53369), (70.371961, 61.94992)], [(193.044227, 71.53369), (70.371961, 71.53369)], [(207.044227, 172.04992), (216.627997, 172.04992)], [(216.627997, 85.53369), (216.627997, 172.04992)], [(207.044227, 85.53369), (216.627997, 85.53369)], [(207.044227, 172.04992), (207.044227, 85.53369)]])\nVISIBLE_CIRCLES = [(112.984432, 129.437448, 2.582574), (169.801061, 99.737847, 2.582574), (169.801061, 129.437448, 2.582574)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(115.567, 71.5338, 115.567, 61.95), (172.3837, 71.5338, 172.3837, 61.95), (110.4019, 61.95, 110.4019, 71.5338), (167.2185, 61.95, 167.2185, 71.5338), (216.628, 132.0201, 207.0442, 132.0201), (216.628, 126.855, 207.0442, 126.855), (216.628, 102.3205, 207.0442, 102.3205), (216.628, 97.1554, 207.0442, 97.1554)]\nDIMENSIONS = [('vertical', '70.5263', (193.0442, 172.0499), (193.0442, 85.5337), (204.0442, 128.7918)), ('horizontal', '100', (70.372, 172.0499), (193.0442, 172.0499), (131.7081, 183.0499)), ('vertical', '70.5263', (70.372, 85.5337), (70.372, 172.0499), (59.372, 128.7918)), ('horizontal', '100', (193.0442, 85.5337), (70.372, 85.5337), (131.7081, 74.5337)), ('diameter', '%%c4.2105', (112.9844, 129.4375), 2.5826, 45), ('horizontal', '34.7368', (70.372, 129.4375), (112.9844, 129.4375), (91.6782, 140.4375)), ('vertical', '35.7895', (112.9844, 85.5337), (112.9844, 129.4375), (101.9844, 107.4856)), ('diameter', '%%c4.2105', (169.801, 99.738), 2.5826, 45), ('horizontal', '81.0526', (70.372, 99.738), (169.801, 99.738), (120.0865, 110.738)), ('vertical', '11.5789', (169.801, 85.5337), (169.801, 99.738), (158.801, 92.6358)), ('diameter', '%%c4.2105', (169.801, 129.4375), 2.5826, 45), ('horizontal', '81.0526', (70.372, 129.4375), (169.801, 129.4375), (120.0865, 140.4375)), ('vertical', '35.7895', (169.801, 85.5337), (169.801, 129.4375), (158.801, 107.4856)), ('horizontal', '7.8125', (207.0442, 85.5337), (216.628, 85.5337), (211.8361, 96.5337))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0010_00100853_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0026_00263555","images":["images/0026_00263555.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 100 x 66.32 mm bounding box. It is extruded to a thickness of 200 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5517509881422991\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(108.912413, 160.8802), (108.912413, 197.470003), (72.322611, 197.470003), (72.322611, 179.465497), (53.737314, 179.465497), (53.737314, 160.8802), (108.912413, 160.8802)], [(108.912413, 146.8802), (108.912413, 36.530003), (72.322611, 36.530003)], [(72.322611, 146.8802), (72.322611, 36.530003)], [(108.912413, 146.8802), (72.322611, 146.8802)], [(72.322611, 36.530003), (53.737314, 36.530003)], [(53.737314, 146.8802), (53.737314, 36.530003)], [(72.322611, 146.8802), (53.737314, 146.8802)], [(122.912413, 197.470003), (233.262611, 197.470003), (233.262611, 179.465497)], [(122.912413, 197.470003), (122.912413, 179.465497), (233.262611, 179.465497), (233.262611, 160.8802)], [(122.912413, 160.8802), (233.262611, 160.8802)], [(122.912413, 179.465497), (122.912413, 160.8802)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '66.3158', (108.9124, 197.47), (108.9124, 160.8802), (119.9124, 179.1751)), ('horizontal', '66.3158', (72.3226, 197.47), (108.9124, 197.47), (90.6175, 208.47)), ('vertical', '32.6316', (72.3226, 179.4655), (72.3226, 197.47), (61.3226, 188.4678)), ('horizontal', '33.6842', (53.7373, 179.4655), (72.3226, 179.4655), (63.03, 190.4655)), ('vertical', '33.6842', (53.7373, 160.8802), (53.7373, 179.4655), (42.7373, 170.1729)), ('horizontal', '100', (108.9124, 160.8802), (53.7373, 160.8802), (81.3249, 149.8802)), ('horizontal', '200', (122.9125, 160.8802), (233.2626, 160.8802), (178.0875, 171.8802))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0026_00263555_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0027_00270886","images":["images/0027_00270886.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 100 x 100 mm bounding box. It is extruded to a thickness of 66.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.576600000000023\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(146.11, 172.050003), (146.11, 114.390003), (126.687684, 114.390003), (126.687684, 152.627687), (107.872316, 152.627687), (107.872316, 114.390003), (88.45, 114.390003), (88.45, 172.050003), (146.11, 172.050003)], [(146.11, 61.950003), (146.11, 100.390003)], [(88.45, 61.950003), (88.45, 100.390003), (146.11, 100.390003)], [(88.45, 61.950003), (146.11, 61.950003)], [(198.55, 114.390003), (160.11, 114.390003), (160.11, 172.050003)], [(198.55, 172.050003), (160.11, 172.050003)], [(198.55, 114.390003), (198.55, 172.050003)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(126.6877, 61.95, 126.6877, 100.39), (107.8723, 61.95, 107.8723, 100.39), (198.55, 152.6277, 160.11, 152.6277)]\nDIMENSIONS = [('vertical', '100', (146.11, 114.39), (146.11, 172.05), (135.11, 143.22)), ('horizontal', '33.6842', (126.6877, 114.39), (146.11, 114.39), (136.3988, 125.39)), ('vertical', '66.3158', (126.6877, 152.6277), (126.6877, 114.39), (137.6877, 133.5088)), ('horizontal', '32.6316', (107.8723, 152.6277), (126.6877, 152.6277), (117.28, 163.6277)), ('vertical', '66.3158', (107.8723, 114.39), (107.8723, 152.6277), (96.8723, 133.5088)), ('horizontal', '33.6842', (88.45, 114.39), (107.8723, 114.39), (98.1612, 125.39)), ('vertical', '100', (88.45, 172.05), (88.45, 114.39), (99.45, 143.22)), ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)), ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0027_00270886_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0028_00280296","images":["images/0028_00280296.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 74.74 x 100 mm bounding box. It is extruded to a thickness of 83.1 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5248538461538741\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(134.305669, 172.050003), (134.305669, 149.950893), (122.151159, 149.950893), (122.151159, 132.824084), (108.891694, 132.824084), (108.891694, 119.564618), (95.07975, 119.564618), (95.07975, 172.050003), (134.305669, 172.050003)], [(134.305669, 61.950003), (134.305669, 105.564618)], [(95.07975, 61.950003), (95.07975, 105.564618), (134.305669, 105.564618)], [(95.07975, 61.950003), (134.305669, 61.950003)], [(191.920285, 119.564618), (148.305669, 119.564618), (148.305669, 172.050003)], [(191.920285, 172.050003), (148.305669, 172.050003)], [(191.920285, 119.564618), (191.920285, 172.050003)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(122.1511, 61.95, 122.1511, 105.5646), (108.8917, 61.95, 108.8917, 105.5646), (191.9203, 149.9509, 148.3057, 149.9509), (191.9203, 132.8241, 148.3057, 132.8241)]\nDIMENSIONS = [('vertical', '42.1053', (134.3057, 149.9509), (134.3057, 172.05), (123.3057, 161.0004)), ('horizontal', '23.1579', (122.1512, 149.9509), (134.3057, 149.9509), (128.2284, 160.9509)), ('vertical', '32.6316', (122.1512, 132.8241), (122.1512, 149.9509), (111.1512, 141.3875)), ('horizontal', '25.2632', (108.8917, 132.8241), (122.1512, 132.8241), (115.5214, 143.8241)), ('vertical', '25.2632', (108.8917, 119.5646), (108.8917, 132.8241), (97.8917, 126.1943)), ('horizontal', '26.3158', (95.0797, 119.5646), (108.8917, 119.5646), (101.9857, 130.5646)), ('vertical', '100', (95.0797, 172.05), (95.0797, 119.5646), (106.0797, 145.8073)), ('horizontal', '74.7368', (134.3057, 172.05), (95.0797, 172.05), (114.6927, 161.05)), ('horizontal', '83.0986', (191.9203, 172.05), (148.3056, 172.05), (170.113, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0028_00280296_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0029_00292233","images":["images/0029_00292233.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 12 edges within a 25.26 x 100 mm bounding box. It is extruded to a thickness of 25.29 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7670366972477801\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(117.516665, 172.050001), (117.516665, 142.983348), (136.894434, 142.983348), (136.894434, 172.050001), (155.464796, 172.050001), (155.464796, 95.346332), (136.894434, 95.346332), (136.894434, 124.412985), (117.516665, 124.412985), (117.516665, 95.346332), (98.138896, 95.346332), (98.138896, 172.050001), (117.516665, 172.050001)], [(117.516665, 61.950001), (117.516665, 81.346332), (136.894434, 81.346332)], [(117.516665, 61.950001), (136.894434, 61.950001), (136.894434, 81.346332), (155.464796, 81.346332)], [(155.464796, 61.950001), (155.464796, 81.346332)], [(136.894434, 61.950001), (155.464796, 61.950001)], [(98.138896, 61.950001), (98.138896, 81.346332), (117.516665, 81.346332)], [(98.138896, 61.950001), (117.516665, 61.950001)], [(188.861126, 95.346332), (169.464796, 95.346332), (169.464796, 172.050001)], [(188.861126, 172.050001), (169.464796, 172.050001)], [(188.861126, 95.346332), (188.861126, 172.050001)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(188.8611, 142.9833, 169.4648, 142.9833), (188.8611, 124.413, 169.4648, 124.413)]\nDIMENSIONS = [('vertical', '37.8947', (117.5167, 142.9834), (117.5167, 172.05), (106.5167, 157.5167)), ('horizontal', '25.2632', (136.8944, 142.9834), (117.5167, 142.9834), (127.2055, 131.9834)), ('vertical', '37.8947', (136.8944, 172.05), (136.8944, 142.9834), (147.8944, 157.5167)), ('horizontal', '24.2105', (155.4648, 172.05), (136.8944, 172.05), (146.1796, 161.05)), ('vertical', '100', (155.4648, 95.3463), (155.4648, 172.05), (144.4648, 133.6982)), ('horizontal', '24.2105', (136.8944, 95.3463), (155.4648, 95.3463), (146.1796, 106.3463)), ('vertical', '37.8947', (136.8944, 124.413), (136.8944, 95.3463), (147.8944, 109.8797)), ('horizontal', '25.2632', (117.5167, 124.413), (136.8944, 124.413), (127.2055, 135.413)), ('vertical', '37.8947', (117.5167, 95.3463), (117.5167, 124.413), (106.5167, 109.8797)), ('horizontal', '25.2632', (98.1389, 95.3463), (117.5167, 95.3463), (107.8278, 106.3463)), ('vertical', '100', (98.1389, 172.05), (98.1389, 95.3463), (109.1389, 133.6982)), ('horizontal', '25.2632', (117.5167, 172.05), (98.1389, 172.05), (107.8278, 161.05)), ('horizontal', '25.2874', (188.8611, 172.05), (169.4648, 172.05), (179.1629, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0029_00292233_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0030_00304161","images":["images/0030_00304161.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 100 x 100 mm bounding box. It is extruded to a thickness of 0.68 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9545067567567713\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(126.630287, 76.599379), (126.630287, 124.827088), (183.900692, 124.827088), (183.900692, 172.050054), (88.450017, 172.050054), (88.450017, 76.599379), (126.630287, 76.599379)], [(183.900692, 62.599379), (183.900692, 61.950054), (88.450017, 61.950054)], [(88.450017, 62.599379), (88.450017, 61.950054)], [(183.900692, 62.599379), (88.450017, 62.599379)], [(197.900692, 172.050054), (198.550017, 172.050054), (198.550017, 76.599379)], [(197.900692, 76.599379), (198.550017, 76.599379)], [(197.900692, 172.050054), (197.900692, 76.599379)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(126.6303, 62.5993, 126.6303, 61.95), (197.9007, 124.827, 198.55, 124.827)]\nDIMENSIONS = [('vertical', '50.5263', (126.6303, 124.8271), (126.6303, 76.5994), (137.6303, 100.7132)), ('horizontal', '60', (183.9007, 124.8271), (126.6303, 124.8271), (155.2655, 113.8271)), ('vertical', '49.4737', (183.9007, 172.05), (183.9007, 124.8271), (194.9007, 148.4385)), ('horizontal', '100', (88.45, 172.05), (183.9007, 172.05), (136.1754, 183.05)), ('vertical', '100', (88.45, 76.5994), (88.45, 172.05), (77.45, 124.3247)), ('horizontal', '40', (126.6303, 76.5994), (88.45, 76.5994), (107.5402, 65.5994)), ('horizontal', '0.6803', (197.9007, 76.5994), (198.55, 76.5994), (198.2254, 87.5994))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0030_00304161_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0037_00374270","images":["images/0037_00374270.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 100 x 66.32 mm bounding box. It is extruded to a thickness of 33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9643838028169066\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(168.646085, 108.096105), (168.646085, 140.580612), (104.692212, 140.580612), (104.692212, 172.049978), (72.207705, 172.049978), (72.207705, 108.096105), (168.646085, 108.096105)], [(168.646085, 94.096105), (168.646085, 61.949978), (104.692212, 61.949978)], [(168.646085, 94.096105), (104.692212, 94.096105), (104.692212, 61.949978), (72.207705, 61.949978)], [(72.207705, 94.096105), (72.207705, 61.949978)], [(104.692212, 94.096105), (72.207705, 94.096105)], [(182.646085, 172.049978), (214.792212, 172.049978), (214.792212, 108.096105)], [(182.646085, 108.096105), (214.792212, 108.096105)], [(182.646085, 172.049978), (182.646085, 108.096105)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(182.6461, 140.5806, 214.7923, 140.5806)]\nDIMENSIONS = [('vertical', '33.6842', (168.6461, 140.5806), (168.6461, 108.0961), (179.6461, 124.3384)), ('horizontal', '66.3158', (104.6922, 140.5806), (168.6461, 140.5806), (136.6692, 151.5806)), ('vertical', '32.6316', (104.6922, 172.05), (104.6922, 140.5806), (115.6922, 156.3153)), ('horizontal', '33.6842', (72.2077, 172.05), (104.6922, 172.05), (88.45, 183.05)), ('vertical', '66.3158', (72.2077, 108.0961), (72.2077, 172.05), (61.2077, 140.0731)), ('horizontal', '100', (168.6461, 108.0961), (72.2077, 108.0961), (120.4269, 97.0961)), ('horizontal', '33.3333', (182.6461, 108.0961), (214.7922, 108.0961), (198.7192, 119.0961))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0037_00374270_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0038_00388807","images":["images/0038_00388807.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 60 mm tall. It is extruded to a thickness of 50 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8736363636363634\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(158.340909, 172.049994), (158.340909, 119.631812), (70.977273, 119.631812), (70.977273, 172.049994), (158.340909, 172.049994)], [(158.340909, 61.949994), (158.340909, 105.631812)], [(70.977273, 61.949994), (70.977273, 105.631812), (158.340909, 105.631812)], [(70.977273, 61.949994), (158.340909, 61.949994)], [(216.022727, 119.631812), (172.340909, 119.631812)], [(172.340909, 172.049994), (172.340909, 119.631812)], [(216.022727, 172.049994), (172.340909, 172.049994)], [(216.022727, 119.631812), (216.022727, 172.049994)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '60', (158.3409, 119.6318), (158.3409, 172.05), (147.3409, 145.8409)), ('horizontal', '100', (70.9773, 119.6318), (158.3409, 119.6318), (114.6591, 130.6318)), ('vertical', '60', (70.9773, 172.05), (70.9773, 119.6318), (81.9773, 145.8409)), ('horizontal', '100', (158.3409, 172.05), (70.9773, 172.05), (114.6591, 161.05)), ('horizontal', '50', (216.0227, 172.05), (172.3409, 172.05), (194.1818, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0038_00388807_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0041_00416656","images":["images/0041_00416656.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 12 edges within a 9.47 x 100 mm bounding box. It is extruded to a thickness of 100 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.48050000000000725\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(114.751044, 123.999996), (114.751044, 172.049996), (110.198939, 172.049996), (110.198939, 167.497891), (112.222097, 167.497891), (112.222097, 163.451575), (110.198939, 163.451575), (110.198939, 141.702628), (112.222097, 141.702628), (112.222097, 132.598417), (110.198939, 132.598417), (110.198939, 123.999996), (114.751044, 123.999996)], [(114.751044, 109.999996), (114.751044, 61.949996), (110.198939, 61.949996)], [(110.198939, 109.999996), (110.198939, 61.949996)], [(114.751044, 109.999996), (110.198939, 109.999996)], [(128.751044, 172.049996), (176.801044, 172.049996), (176.801044, 167.497891)], [(128.751044, 167.497891), (176.801044, 167.497891)], [(128.751044, 172.049996), (128.751044, 167.497891)], [(176.801044, 167.497891), (176.801044, 163.451575)], [(128.751044, 167.497891), (128.751044, 163.451575), (176.801044, 163.451575), (176.801044, 141.702628)], [(128.751044, 141.702628), (176.801044, 141.702628)], [(128.751044, 163.451575), (128.751044, 141.702628)], [(176.801044, 141.702628), (176.801044, 132.598417)], [(128.751044, 141.702628), (128.751044, 132.598417), (176.801044, 132.598417), (176.801044, 123.999996)], [(128.751044, 123.999996), (176.801044, 123.999996)], [(128.751044, 132.598417), (128.751044, 123.999996)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(112.2221, 110.0, 112.2221, 61.95)]\nDIMENSIONS = [('vertical', '100', (114.7511, 172.05), (114.7511, 124.0), (125.7511, 148.025)), ('horizontal', '9.4737', (110.1989, 172.05), (114.7511, 172.05), (112.475, 183.05)), ('vertical', '9.4737', (110.1989, 167.4979), (110.1989, 172.05), (99.1989, 169.774)), ('horizontal', '4.2105', (112.2221, 167.4979), (110.1989, 167.4979), (111.2105, 156.4979)), ('vertical', '8.4211', (112.2221, 163.4516), (112.2221, 167.4979), (101.2221, 165.4747)), ('horizontal', '4.2105', (110.1989, 163.4516), (112.2221, 163.4516), (111.2105, 174.4516)), ('vertical', '45.2632', (110.1989, 141.7026), (110.1989, 163.4516), (99.1989, 152.5771)), ('horizontal', '4.2105', (112.2221, 141.7026), (110.1989, 141.7026), (111.2105, 130.7026)), ('vertical', '18.9474', (112.2221, 132.5984), (112.2221, 141.7026), (101.2221, 137.1505)), ('horizontal', '4.2105', (110.1989, 132.5984), (112.2221, 132.5984), (111.2105, 143.5984)), ('vertical', '17.8947', (110.1989, 124.0), (110.1989, 132.5984), (99.1989, 128.2992)), ('horizontal', '9.4737', (114.7511, 124.0), (110.1989, 124.0), (112.475, 113.0)), ('horizontal', '100', (128.7511, 124.0), (176.8011, 124.0), (152.7761, 135.0))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0041_00416656_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0046_00467569","images":["images/0046_00467569.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 100 x 33.68 mm bounding box. It is extruded to a thickness of 39.58 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.0991574803149589\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(169.703706, 164.266277), (169.703706, 127.242025), (159.290635, 127.242025), (159.290635, 152.696198), (71.358037, 152.696198), (71.358037, 127.242025), (59.787958, 127.242025), (59.787958, 164.266277), (169.703706, 164.266277)], [(169.703706, 69.733708), (169.703706, 113.242025)], [(59.787958, 69.733708), (59.787958, 113.242025), (169.703706, 113.242025)], [(59.787958, 69.733708), (169.703706, 69.733708)], [(227.212023, 127.242025), (183.703706, 127.242025), (183.703706, 164.266277)], [(227.212023, 164.266277), (183.703706, 164.266277)], [(227.212023, 127.242025), (227.212023, 164.266277)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(159.2906, 69.7337, 159.2906, 113.242), (71.358, 69.7337, 71.358, 113.242), (227.212, 152.6962, 183.7037, 152.6962)]\nDIMENSIONS = [('vertical', '33.6842', (169.7037, 127.242), (169.7037, 164.2663), (158.7037, 145.7542)), ('horizontal', '9.4737', (159.2906, 127.242), (169.7037, 127.242), (164.4972, 138.242)), ('vertical', '23.1579', (159.2906, 152.6962), (159.2906, 127.242), (170.2906, 139.9691)), ('horizontal', '80', (71.358, 152.6962), (159.2906, 152.6962), (115.3243, 163.6962)), ('vertical', '23.1579', (71.358, 127.242), (71.358, 152.6962), (60.358, 139.9691)), ('horizontal', '10.5263', (59.788, 127.242), (71.358, 127.242), (65.573, 138.242)), ('vertical', '33.6842', (59.788, 164.2663), (59.788, 127.242), (70.788, 145.7542)), ('horizontal', '100', (169.7037, 164.2663), (59.788, 164.2663), (114.7458, 153.2663)), ('horizontal', '39.5833', (227.212, 164.2663), (183.7038, 164.2663), (205.4579, 153.2663))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0046_00467569_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00481253","images":["images/0048_00481253.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 83.16 x 100 mm bounding box. It is extruded to a thickness of 83.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5241818181818276\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.454013, 172.050008), (136.454013, 154.393357), (110.520808, 154.393357), (110.520808, 119.631826), (92.864157, 119.631826), (92.864157, 172.050008), (136.454013, 172.050008)], [(136.454013, 61.950008), (136.454013, 105.631826)], [(92.864157, 61.950008), (92.864157, 105.631826), (136.454013, 105.631826)], [(92.864157, 61.950008), (136.454013, 61.950008)], [(194.135831, 119.631826), (150.454013, 119.631826), (150.454013, 172.050008)], [(194.135831, 172.050008), (150.454013, 172.050008)], [(194.135831, 119.631826), (194.135831, 172.050008)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(110.5208, 61.95, 110.5208, 105.6318), (194.1358, 154.3933, 150.454, 154.3933)]\nDIMENSIONS = [('vertical', '33.6842', (136.454, 154.3934), (136.454, 172.05), (125.454, 163.2217)), ('horizontal', '49.4737', (110.5208, 154.3934), (136.454, 154.3934), (123.4874, 165.3934)), ('vertical', '66.3158', (110.5208, 119.6318), (110.5208, 154.3934), (99.5208, 137.0126)), ('horizontal', '33.6842', (92.8642, 119.6318), (110.5208, 119.6318), (101.6925, 130.6318)), ('vertical', '100', (92.8642, 172.05), (92.8642, 119.6318), (103.8642, 145.8409)), ('horizontal', '83.1579', (136.454, 172.05), (92.8642, 172.05), (114.6591, 161.05)), ('horizontal', '83.3333', (194.1358, 172.05), (150.454, 172.05), (172.2949, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00481253_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0051_00518804","images":["images/0051_00518804.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 100 x 66.32 mm bounding box. It is extruded to a thickness of 39.58 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8835000000000012\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(163.189073, 170.7809), (163.189073, 112.1909), (146.449072, 112.1909), (146.449072, 156.8309), (91.579073, 156.8309), (91.579073, 112.1909), (74.839073, 112.1909), (74.839073, 170.7809), (163.189073, 170.7809)], [(163.189073, 63.219025), (163.189073, 98.1909)], [(74.839073, 63.219025), (74.839073, 98.1909), (163.189073, 98.1909)], [(74.839073, 63.219025), (163.189073, 63.219025)], [(212.160947, 112.1909), (177.189073, 112.1909), (177.189073, 170.7809)], [(212.160947, 170.7809), (177.189073, 170.7809)], [(212.160947, 112.1909), (212.160947, 170.7809)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(146.4491, 63.2191, 146.4491, 98.1909), (91.5791, 63.2191, 91.5791, 98.1909), (212.1609, 156.8309, 177.1891, 156.8309)]\nDIMENSIONS = [('vertical', '66.3158', (163.1891, 112.1909), (163.1891, 170.7809), (152.1891, 141.4859)), ('horizontal', '18.9474', (146.449, 112.1909), (163.1891, 112.1909), (154.819, 123.1909)), ('vertical', '50.5263', (146.449, 156.8309), (146.449, 112.1909), (157.449, 134.5109)), ('horizontal', '62.1053', (91.5791, 156.8309), (146.449, 156.8309), (119.0141, 167.8309)), ('vertical', '50.5263', (91.5791, 112.1909), (91.5791, 156.8309), (80.5791, 134.5109)), ('horizontal', '18.9474', (74.8391, 112.1909), (91.5791, 112.1909), (83.2091, 123.1909)), ('vertical', '66.3158', (74.8391, 170.7809), (74.8391, 112.1909), (85.8391, 141.4859)), ('horizontal', '100', (163.1891, 170.7809), (74.8391, 170.7809), (119.0141, 159.7809)), ('horizontal', '39.5833', (212.1609, 170.7809), (177.1891, 170.7809), (194.675, 159.7809))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0051_00518804_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00625465","images":["images/0062_00625465.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 100 x 100 mm bounding box. It is extruded to a thickness of 111.63 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.45409890109899587\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(133.859895, 172.049996), (133.859895, 156.754033), (118.563932, 156.754033), (118.563932, 141.936069), (103.745968, 141.936069), (103.745968, 126.640106), (88.450005, 126.640106), (88.450005, 172.049996), (133.859895, 172.049996)], [(133.859895, 61.949996), (133.859895, 112.640106)], [(88.450005, 61.949996), (88.450005, 112.640106), (133.859895, 112.640106)], [(88.450005, 61.949996), (133.859895, 61.949996)], [(198.550005, 126.640106), (147.859895, 126.640106), (147.859895, 172.049996)], [(198.550005, 172.049996), (147.859895, 172.049996)], [(198.550005, 126.640106), (198.550005, 172.049996)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(118.5639, 61.95, 118.5639, 112.6401), (103.746, 61.95, 103.746, 112.6401), (198.55, 156.754, 147.8599, 156.754), (198.55, 141.9361, 147.8599, 141.9361)]\nDIMENSIONS = [('vertical', '33.6842', (133.8599, 156.754), (133.8599, 172.05), (122.8599, 164.402)), ('horizontal', '33.6842', (118.5639, 156.754), (133.8599, 156.754), (126.2119, 167.754)), ('vertical', '32.6316', (118.5639, 141.9361), (118.5639, 156.754), (107.5639, 149.3451)), ('horizontal', '32.6316', (103.746, 141.9361), (118.5639, 141.9361), (111.1549, 152.9361)), ('vertical', '33.6842', (103.746, 126.6401), (103.746, 141.9361), (92.746, 134.2881)), ('horizontal', '33.6842', (88.45, 126.6401), (103.746, 126.6401), (96.098, 137.6401)), ('vertical', '100', (88.45, 172.05), (88.45, 126.6401), (99.45, 149.3451)), ('horizontal', '100', (133.8599, 172.05), (88.45, 172.05), (111.1549, 161.05)), ('horizontal', '111.628', (198.55, 172.05), (147.8599, 172.05), (173.2049, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00625465_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0068_00685866","images":["images/0068_00685866.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectilinear stepped plate with 8 edges within a 100 x 100 mm bounding box. It is extruded to a thickness of 66.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5766000000000505\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(146.11, 172.05), (146.11, 152.627684), (126.687684, 152.627684), (126.687684, 133.812316), (107.872316, 133.812316), (107.872316, 114.39), (88.45, 114.39), (88.45, 172.05), (146.11, 172.05)], [(146.11, 61.95), (146.11, 100.39)], [(88.45, 61.95), (88.45, 100.39), (146.11, 100.39)], [(88.45, 61.95), (146.11, 61.95)], [(198.55, 114.39), (160.11, 114.39), (160.11, 172.05)], [(198.55, 172.05), (160.11, 172.05)], [(198.55, 114.39), (198.55, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(126.6877, 61.95, 126.6877, 100.39), (107.8723, 61.95, 107.8723, 100.39), (198.55, 152.6277, 160.11, 152.6277), (198.55, 133.8123, 160.11, 133.8123)]\nDIMENSIONS = [('vertical', '33.6842', (146.11, 152.6277), (146.11, 172.05), (135.11, 162.3389)), ('horizontal', '33.6842', (126.6877, 152.6277), (146.11, 152.6277), (136.3988, 163.6277)), ('vertical', '32.6316', (126.6877, 133.8123), (126.6877, 152.6277), (115.6877, 143.22)), ('horizontal', '32.6316', (107.8723, 133.8123), (126.6877, 133.8123), (117.28, 144.8123)), ('vertical', '33.6842', (107.8723, 114.39), (107.8723, 133.8123), (96.8723, 124.1012)), ('horizontal', '33.6842', (88.45, 114.39), (107.8723, 114.39), (98.1611, 125.39)), ('vertical', '100', (88.45, 172.05), (88.45, 114.39), (99.45, 143.22)), ('horizontal', '100', (146.11, 172.05), (88.45, 172.05), (117.28, 161.05)), ('horizontal', '66.6667', (198.55, 172.05), (160.11, 172.05), (179.33, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0068_00685866_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0068_00685884","images":["images/0068_00685884.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 75.79 x 100 mm bounding box. It is extruded to a thickness of 58.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6069473684210539\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(118.158495, 111.355269), (118.158495, 152.244355), (141.797498, 152.244355), (141.797498, 172.050006), (95.797277, 172.050006), (95.797277, 111.355269), (118.158495, 111.355269)], [(141.797498, 97.355269), (141.797498, 61.950006), (95.797277, 61.950006)], [(95.797277, 97.355269), (95.797277, 61.950006)], [(141.797498, 97.355269), (95.797277, 97.355269)], [(155.797498, 172.050006), (191.202761, 172.050006), (191.202761, 111.355269)], [(155.797498, 111.355269), (191.202761, 111.355269)], [(155.797498, 172.050006), (155.797498, 111.355269)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(118.1585, 97.3553, 118.1585, 61.95), (155.7975, 152.2443, 191.2027, 152.2443)]\nDIMENSIONS = [('vertical', '67.3684', (118.1585, 152.2443), (118.1585, 111.3553), (129.1585, 131.7998)), ('horizontal', '38.9474', (141.7975, 152.2443), (118.1585, 152.2443), (129.978, 141.2443)), ('vertical', '32.6316', (141.7975, 172.05), (141.7975, 152.2443), (152.7975, 162.1472)), ('horizontal', '75.7895', (95.7973, 172.05), (141.7975, 172.05), (118.7974, 183.05)), ('vertical', '100', (95.7973, 111.3553), (95.7973, 172.05), (84.7973, 141.7026)), ('horizontal', '36.8421', (118.1585, 111.3553), (95.7973, 111.3553), (106.9779, 100.3553)), ('horizontal', '58.3333', (155.7975, 111.3553), (191.2027, 111.3553), (173.5001, 122.3553))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0068_00685884_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0073_00739774","images":["images/0073_00739774.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 74.74 x 100 mm bounding box. It is extruded to a thickness of 12.5 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8409216867469886\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.668137, 171.301827), (162.668137, 150.057489), (131.686811, 150.057489), (131.686811, 87.209658), (99.820305, 87.209658), (99.820305, 171.301827), (162.668137, 171.301827)], [(162.668137, 62.698137), (162.668137, 73.209658)], [(99.820305, 62.698137), (99.820305, 73.209658), (162.668137, 73.209658)], [(99.820305, 62.698137), (162.668137, 62.698137)], [(187.179658, 87.209658), (176.668137, 87.209658), (176.668137, 171.301827)], [(187.179658, 171.301827), (176.668137, 171.301827)], [(187.179658, 87.209658), (187.179658, 171.301827)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(131.6868, 62.6982, 131.6868, 73.2097), (187.1797, 150.0575, 176.6682, 150.0575)]\nDIMENSIONS = [('vertical', '25.2632', (162.6681, 150.0575), (162.6681, 171.3018), (151.6681, 160.6797)), ('horizontal', '36.8421', (131.6868, 150.0575), (162.6681, 150.0575), (147.1775, 161.0575)), ('vertical', '74.7368', (131.6868, 87.2097), (131.6868, 150.0575), (120.6868, 118.6336)), ('horizontal', '37.8947', (99.8203, 87.2097), (131.6868, 87.2097), (115.7536, 98.2097)), ('vertical', '100', (99.8203, 171.3018), (99.8203, 87.2097), (110.8203, 129.2558)), ('horizontal', '74.7368', (162.6681, 171.3018), (99.8203, 171.3018), (131.2442, 160.3018)), ('horizontal', '12.5', (187.1797, 171.3018), (176.6682, 171.3018), (181.9239, 160.3018))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0073_00739774_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0076_00762162","images":["images/0076_00762162.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is an L-shaped (stepped) plate within a 100 x 77.89 mm bounding box. It is extruded to a thickness of 44.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.783297881848288\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(158.12229, 172.049997), (158.12229, 154.734991), (97.107508, 154.734991), (97.107508, 111.035215), (79.792502, 111.035215), (79.792502, 172.049997), (158.12229, 172.049997)], [(158.12229, 61.949997), (158.12229, 97.035215)], [(79.792502, 61.949997), (79.792502, 97.035215), (158.12229, 97.035215)], [(79.792502, 61.949997), (158.12229, 61.949997)], [(207.207508, 111.035215), (172.12229, 111.035215), (172.12229, 172.049997)], [(207.207508, 172.049997), (172.12229, 172.049997)], [(207.207508, 111.035215), (207.207508, 172.049997)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(97.1075, 61.95, 97.1075, 97.0352), (207.2075, 154.735, 172.1223, 154.735)]\nDIMENSIONS = [('vertical', '22.1053', (158.1223, 154.735), (158.1223, 172.05), (147.1223, 163.3925)), ('horizontal', '77.8947', (97.1075, 154.735), (158.1223, 154.735), (127.6149, 165.735)), ('vertical', '55.7895', (97.1075, 111.0352), (97.1075, 154.735), (86.1075, 132.8851)), ('horizontal', '22.1053', (79.7925, 111.0352), (97.1075, 111.0352), (88.45, 122.0352)), ('vertical', '77.8947', (79.7925, 172.05), (79.7925, 111.0352), (90.7925, 141.5426)), ('horizontal', '100', (158.1223, 172.05), (79.7925, 172.05), (118.9574, 161.05)), ('horizontal', '44.7917', (207.2075, 172.05), (172.1223, 172.05), (189.6649, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0076_00762162_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0049_00493328","images":["images/0049_00493328.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 54.74 mm tall. It is extruded to a thickness of 181.13 mm. A cut feature: The part is a rectangular plate 83.02 mm wide and 27.96 mm tall. It is extruded to a thickness of -22.64 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.2304550866832365\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(106.279946, 172.05), (106.279946, 159.435616)], [(83.234438, 172.05), (106.279946, 172.05)], [(106.279946, 159.435616), (83.234438, 159.435616), (83.234438, 172.05)], [(106.279946, 145.435616), (106.279946, 61.95)], [(83.234438, 145.435616), (83.234438, 61.95)], [(83.234438, 145.435616), (106.279946, 145.435616)], [(83.234438, 61.95), (106.279946, 61.95)], [(120.279946, 172.05), (203.765562, 172.05)], [(120.279946, 159.435616), (120.279946, 172.05)], [(203.765562, 159.435616), (120.279946, 159.435616)], [(203.765562, 159.435616), (203.765562, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(104.1058, 169.0063), (104.1058, 162.5617)], [(84.9737, 169.0063), (104.1058, 169.0063)], [(84.9737, 162.5617), (84.9737, 169.0063)], [(104.1058, 162.5617), (84.9737, 162.5617)], [(104.1058, 145.4356), (104.1058, 140.2178), (84.9737, 140.2178), (84.9737, 145.4356)], [(120.2799, 169.0063), (125.4978, 169.0063), (125.4978, 162.5617), (120.2799, 162.5617)]])\nDIMENSIONS = [('horizontal', '83.0188', (84.9737, 169.0063), (104.1058, 169.0063), (94.5398, 180.0063)), ('vertical', '27.9643', (84.9737, 169.0063), (84.9737, 162.5617), (95.9737, 165.784)), ('horizontal', '7.5472', (83.2344, 169.0063), (84.9737, 169.0063), (84.1041, 180.0063)), ('vertical', '13.2075', (84.9737, 172.05), (84.9737, 169.0063), (95.9737, 170.5281)), ('horizontal', '22.6415', (120.2799, 169.0063), (125.4978, 169.0063), (122.8889, 180.0063))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0049_00493328_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0055_00555415","images":["images/0055_00555415.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a square plate 100 x 100 mm. It is extruded to a thickness of 18.52 mm. A cut feature: The part is a rectangular plate 9.86 mm wide and 85.19 mm tall. It is extruded to a thickness of -51.85 mm. A cut feature: The part is a rectangular plate 9.86 mm wide and 85.19 mm tall. It is extruded to a thickness of -51.85 mm. A cut feature: The part is a rectangular plate 9.86 mm wide and 85.19 mm tall. It is extruded to a thickness of -51.85 mm. A cut feature: The part is a rectangular plate 9.86 mm wide and 85.19 mm tall. It is extruded to a thickness of -51.85 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(166.432215, 94.067805), (166.432215, 167.537805)], [(92.962215, 94.067805), (166.432215, 94.067805)], [(166.432215, 167.537805), (92.962215, 167.537805), (92.962215, 94.067805)], [(108.372297, 99.510027), (108.372297, 162.095583)], [(101.125548, 99.510027), (108.372297, 99.510027)], [(101.125548, 162.095583), (101.125548, 99.510027)], [(108.372297, 162.095583), (101.125548, 162.095583)], [(124.698963, 99.510027), (124.698963, 162.095583)], [(117.452215, 99.510027), (124.698963, 99.510027)], [(117.452215, 162.095583), (117.452215, 99.510027)], [(124.698963, 162.095583), (117.452215, 162.095583)], [(141.02563, 99.510027), (141.02563, 162.095583)], [(133.778881, 99.510027), (141.02563, 99.510027)], [(133.778881, 162.095583), (133.778881, 99.510027)], [(141.02563, 162.095583), (133.778881, 162.095583)], [(157.352297, 99.510027), (157.352297, 162.095583)], [(150.105548, 99.510027), (157.352297, 99.510027)], [(150.105548, 162.095583), (150.105548, 99.510027)], [(157.352297, 162.095583), (150.105548, 162.095583)], [(166.432215, 80.067805), (166.432215, 66.46225)], [(92.962215, 80.067805), (92.962215, 66.46225), (166.432215, 66.46225)], [(92.962215, 80.067805), (166.432215, 80.067805)], [(194.03777, 94.067805), (180.432215, 94.067805)], [(194.03777, 167.537805), (180.432215, 167.537805)], [(194.03777, 167.537805), (194.03777, 94.067805)], [(180.432215, 167.537805), (180.432215, 94.067805)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(108.3723, 80.0678, 108.3723, 66.4622), (101.1256, 80.0678, 101.1256, 66.4622), (124.699, 80.0678, 124.699, 66.4622), (117.4522, 80.0678, 117.4522, 66.4622), (141.0256, 80.0678, 141.0256, 66.4622), (133.7789, 80.0678, 133.7789, 66.4622), (157.3523, 80.0678, 157.3523, 66.4622), (150.1056, 80.0678, 150.1056, 66.4622), (180.4322, 162.0956, 194.0378, 162.0956), (180.4322, 99.51, 194.0378, 99.51)]\nDIMENSIONS = [('horizontal', '100', (166.4322, 94.0678), (92.9622, 94.0678), (129.6972, 83.0678)), ('vertical', '100', (166.4322, 167.5378), (166.4322, 94.0678), (177.4322, 130.8028)), ('horizontal', '9.8635', (117.4522, 162.0956), (124.699, 162.0956), (121.0756, 173.0956)), ('vertical', '85.1852', (117.4522, 162.0956), (117.4522, 99.51), (128.4522, 130.8028)), ('horizontal', '33.3334', (92.9622, 162.0956), (117.4522, 162.0956), (105.2072, 173.0956)), ('vertical', '7.4074', (117.4522, 167.5378), (117.4522, 162.0956), (128.4522, 164.8167)), ('horizontal', '9.8635', (133.7789, 162.0956), (141.0256, 162.0956), (137.4022, 173.0956)), ('vertical', '85.1852', (133.7789, 162.0956), (133.7789, 99.51), (144.7789, 130.8028)), ('horizontal', '55.5556', (92.9622, 162.0956), (133.7789, 162.0956), (113.3705, 173.0956)), ('vertical', '7.4074', (133.7789, 167.5378), (133.7789, 162.0956), (144.7789, 164.8167)), ('horizontal', '9.8636', (150.1055, 162.0956), (157.3523, 162.0956), (153.7289, 173.0956)), ('vertical', '85.1852', (150.1055, 162.0956), (150.1055, 99.51), (161.1055, 130.8028)), ('horizontal', '77.7778', (92.9622, 162.0956), (150.1055, 162.0956), (121.5339, 173.0956)), ('vertical', '7.4074', (150.1055, 167.5378), (150.1055, 162.0956), (161.1055, 164.8167)), ('horizontal', '9.8635', (101.1256, 162.0956), (108.3723, 162.0956), (104.7489, 173.0956)), ('vertical', '85.1852', (101.1256, 162.0956), (101.1256, 99.51), (112.1256, 130.8028)), ('horizontal', '11.1112', (92.9622, 162.0956), (101.1256, 162.0956), (97.0439, 173.0956)), ('vertical', '7.4074', (101.1256, 167.5378), (101.1256, 162.0956), (112.1256, 164.8167)), ('horizontal', '18.5185', (194.0378, 167.5378), (180.4322, 167.5378), (187.235, 156.5378))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0055_00555415_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0096_00962627","images":["images/0096_00962627.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 74.74 mm tall. It is extruded to a thickness of 35.42 mm. A cut feature: The part is a rectangular plate 85.94 mm wide and 63.32 mm tall. It is extruded to a thickness of -33.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.872418873183379\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(164.671859, 106.848183), (164.671859, 172.050014)], [(77.429972, 106.848183), (164.671859, 106.848183)], [(164.671859, 172.050014), (77.429972, 172.050014), (77.429972, 106.848183)], [(158.310472, 111.392031), (158.310472, 166.63566)], [(83.336975, 111.392031), (158.310472, 111.392031)], [(83.336975, 166.63566), (83.336975, 111.392031)], [(158.310472, 166.63566), (83.336975, 166.63566)], [(164.671859, 92.848183), (164.671859, 61.950014), (77.429972, 61.950014)], [(77.429972, 92.848183), (77.429972, 61.950014)], [(164.671859, 92.848183), (77.429972, 92.848183)], [(178.671859, 106.848183), (209.570028, 106.848183)], [(178.671859, 172.050014), (209.570028, 172.050014)], [(178.671859, 172.050014), (178.671859, 106.848183)], [(209.570028, 172.050014), (209.570028, 106.848183)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(158.3105, 61.95), (158.3105, 91.0306), (83.337, 91.0306)], [(83.337, 61.95), (83.337, 91.0306)], [(209.57, 111.392), (180.4894, 111.392), (180.4894, 166.6356)], [(209.57, 166.6356), (180.4894, 166.6356)]])\nDIMENSIONS = [('horizontal', '100', (164.6719, 172.05), (77.43, 172.05), (121.0509, 161.05)), ('vertical', '74.7368', (164.6719, 106.8482), (164.6719, 172.05), (153.6719, 139.4491)), ('horizontal', '85.9375', (83.3369, 111.392), (158.3104, 111.392), (120.8237, 122.392)), ('vertical', '63.3224', (83.3369, 111.392), (83.3369, 166.6357), (72.3369, 139.0138)), ('horizontal', '6.7708', (77.43, 111.392), (83.3369, 111.392), (80.3835, 122.392)), ('vertical', '5.2083', (83.3369, 106.8482), (83.3369, 111.392), (72.3369, 109.1201)), ('horizontal', '35.4167', (178.6719, 106.8482), (209.5701, 106.8482), (194.121, 117.8482)), ('horizontal', '33.3333', (209.5701, 111.392), (180.4895, 111.392), (195.0298, 100.392))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0096_00962627_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0002_00029294","images":["images/0002_00029294.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 1.95 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7164293009037653\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(99.973335, 155.078767), (171.616266, 155.078767)], [(178.871246, 147.823787), (178.871246, 102.48016)], [(171.616266, 94.318307), (99.973335, 94.318307)], [(92.718355, 102.48016), (92.718355, 147.823787)], [(92.718355, 78.921233), (99.973335, 78.921233)], [(92.718355, 80.318307), (99.973335, 80.318307)], [(92.718355, 78.921233), (92.718355, 80.318307)], [(99.973335, 80.318307), (171.616266, 80.318307)], [(99.973335, 78.921233), (171.616266, 78.921233), (178.871246, 78.921233), (178.871246, 80.318307)], [(171.616266, 80.318307), (178.871246, 80.318307)], [(178.871246, 78.921233), (178.884571, 78.921233)], [(178.871246, 80.318307), (178.884571, 80.318307)], [(92.70503, 78.921233), (92.718355, 78.921233)], [(92.70503, 80.318307), (92.718355, 80.318307)], [(178.884571, 80.318307), (178.884571, 78.921233)], [(92.70503, 80.318307), (92.70503, 78.921233)], [(99.973335, 78.921233), (99.973335, 80.318307)], [(171.616266, 78.921233), (171.616266, 80.318307)], [(194.281645, 147.823787), (194.281645, 155.078767), (192.884571, 155.078767)], [(192.884571, 147.823787), (192.884571, 155.078767)], [(194.281645, 94.318307), (192.884571, 94.318307)], [(194.281645, 94.318307), (194.281645, 102.48016), (192.884571, 102.48016)], [(192.884571, 94.318307), (192.884571, 102.48016), (192.884571, 147.823787)], [(194.281645, 102.48016), (194.281645, 147.823787), (192.884571, 147.823787)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(99.973335, 147.823787, 7.25498, 90.0, 180.0), (171.616266, 147.823787, 7.25498, -0.0, 90.0), (171.162829, 102.026724, 7.721741, -86.633539, 3.366461), (100.426772, 102.026724, 7.721741, 176.633539, -93.366461)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (99.9734, 155.0788), (171.6163, 155.0788), (135.7948, 166.0788)), ('vertical', '63.2911', (178.8712, 147.8238), (178.8712, 102.4802), (189.8712, 125.152)), ('radius', 'R10.1266', (99.9734, 147.8238), 7.255, 45), ('radius', 'R10.7781', (171.1628, 102.0267), 7.7217, 45), ('horizontal', '1.9501', (194.2816, 147.8238), (192.8845, 147.8238), (193.5831, 136.8238))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0002_00029294_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0004_00043721","images":["images/0004_00043721.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 361.45 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.18058459052443998\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(98.765069, 159.811614), (86.741117, 150.192453)], [(85.83932, 168.228381), (98.765069, 159.811614)], [(114.180221, 130.42068), (85.83932, 130.42068), (85.83932, 65.147797)], [(114.180221, 65.147797), (85.83932, 65.147797)], [(114.180221, 65.147797), (114.180221, 130.42068)], [(128.180221, 159.811614), (193.453104, 159.811614), (193.453104, 150.192453)], [(128.180221, 150.192453), (193.453104, 150.192453)], [(128.180221, 159.811614), (128.180221, 150.192453), (128.180221, 144.42068)], [(128.180221, 175.247797), (128.180221, 168.228381), (193.453104, 168.228381)], [(193.453104, 150.192453), (193.453104, 144.42068)], [(193.453104, 175.247797), (193.453104, 168.228381), (193.453104, 159.811614)], [(128.180221, 168.228381), (128.180221, 159.811614)], [(193.453104, 175.247797), (128.180221, 175.247797)], [(193.453104, 144.42068), (128.180221, 144.42068)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(98.766662, 159.834239, 15.413558, -141.27822, 147.00303)]\nHIDDEN_SEGMENTS = [(98.7651, 130.4207, 98.7651, 65.1478), (86.7411, 130.4207, 86.7411, 65.1478)]\nDIMENSIONS = [('aligned', '85.2685', (98.7651, 159.8116), (86.7411, 150.1924), (99.6247, 146.4125)), ('aligned', '85.4146', (85.8393, 168.2284), (98.7651, 159.8116), (98.3046, 173.238)), ('radius', 'R85.3537', (98.7667, 159.8342), 15.4136, 45), ('horizontal', '361.453', (128.1802, 159.8116), (193.4531, 159.8116), (160.8167, 170.8116))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0004_00043721_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0004_00049920","images":["images/0004_00049920.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -19.79 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8022633928571077\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(107.375008, 91.823661), (107.375008, 172.05)], [(107.375008, 77.823661), (107.375008, 61.95), (135.62589, 61.95)], [(107.375008, 77.823661), (135.62589, 77.823661)], [(135.62589, 61.95), (135.62589, 77.823661)], [(149.62589, 172.05), (165.499551, 172.05)], [(149.62589, 91.823661), (165.499551, 91.823661), (165.499551, 172.05)], [(149.62589, 91.823661), (149.62589, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(93.022287, 131.93683, 42.603603, -70.3125, 70.3125)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '100', (107.375, 172.05), (107.375, 91.8237), (118.375, 131.9368)), ('radius', 'R53.1043', (93.0223, 131.9368), 42.6036, 45), ('horizontal', '19.7861', (149.6259, 172.05), (165.4996, 172.05), (157.5627, 183.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0004_00049920_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0007_00077684","images":["images/0007_00077684.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 11 straight edges. It is extruded to a thickness of 121.28 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.689572519084368\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(129.530916, 171.316412), (129.530916, 159.579008), (124.395801, 159.579008), (124.395801, 166.914886), (119.260687, 166.914886), (119.260687, 159.579008), (67.175954, 159.579008), (67.175954, 166.914886), (59.840076, 166.914886), (59.840076, 172.05), (128.797328, 172.05)], [(128.797328, 61.95), (129.530916, 61.95), (129.530916, 145.579008)], [(128.797328, 145.579008), (129.530916, 145.579008)], [(59.840076, 61.95), (59.840076, 145.579008), (128.797328, 145.579008)], [(59.840076, 61.95), (128.797328, 61.95), (128.797328, 145.579008)], [(227.159924, 159.579008), (143.530916, 159.579008), (143.530916, 166.914886)], [(227.159924, 159.579008), (227.159924, 166.914886), (143.530916, 166.914886), (143.530916, 172.05)], [(227.159924, 172.05), (143.530916, 172.05)], [(227.159924, 166.914886), (227.159924, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(128.797328, 171.316412, 0.733588, -0.0, 90.0)]\nHIDDEN_SEGMENTS = [(124.3958, 61.95, 124.3958, 145.579), (119.2607, 61.95, 119.2607, 145.579), (67.176, 61.95, 67.176, 145.579)]\nDIMENSIONS = [('horizontal', '7.4468', (129.5309, 159.579), (124.3958, 159.579), (126.9634, 148.579)), ('horizontal', '10.6383', (67.176, 166.9149), (59.8401, 166.9149), (63.508, 155.9149)), ('horizontal', '75.5319', (119.2607, 159.579), (67.176, 159.579), (93.2183, 148.579)), ('horizontal', '100', (59.8401, 172.05), (128.7973, 172.05), (94.3187, 183.05)), ('vertical', '7.4468', (59.8401, 166.9149), (59.8401, 172.05), (48.8401, 169.4825)), ('vertical', '10.6383', (124.3958, 159.579), (124.3958, 166.9149), (113.3958, 163.247)), ('vertical', '17.0213', (129.5309, 171.3164), (129.5309, 159.579), (140.5309, 165.4477)), ('radius', 'R1.0638', (128.7973, 171.3164), 0.7336, 45), ('horizontal', '121.277', (227.1599, 172.05), (143.5309, 172.05), (185.3454, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0007_00077684_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0010_00100694","images":["images/0010_00100694.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 5.73 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.983103756830898\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(182.836438, 150.098773), (182.836438, 102.498491), (165.24503, 102.498491)], [(102.122917, 103.53328), (84.531509, 103.53328), (84.531509, 151.133562), (182.836438, 150.098773)], [(182.836438, 82.866438), (182.836438, 88.498491)], [(84.531509, 82.866438), (84.531509, 88.498491), (182.836438, 88.498491)], [(84.531509, 82.866438), (182.836438, 82.866438)], [(202.468491, 102.498491), (196.836438, 102.498491), (196.836438, 103.53328)], [(202.468491, 102.498491), (202.468491, 103.53328), (196.836438, 103.53328), (196.836438, 151.133562)], [(202.468491, 151.133562), (196.836438, 151.133562)], [(202.468491, 103.53328), (202.468491, 151.133562)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(133.533932, 93.863349, 32.865779, 15.232684, 162.888934)]\nHIDDEN_SEGMENTS = [(165.245, 82.8664, 165.245, 88.4985), (102.1229, 82.8664, 102.1229, 88.4985), (202.4685, 150.0988, 196.8364, 150.0988), (196.8364, 126.7291, 202.4685, 126.7291)]\nDIMENSIONS = [('horizontal', '17.8937', (182.8364, 102.4985), (165.245, 102.4985), (174.0407, 91.4985)), ('vertical', '48.4184', (182.8364, 150.0987), (182.8364, 102.4985), (193.8364, 126.2986)), ('aligned', '100', (84.5315, 151.1336), (182.8364, 150.0987), (133.7998, 161.6155)), ('radius', 'R33.4306', (133.534, 93.8633), 32.8657, 45), ('horizontal', '5.7288', (202.4685, 150.0987), (196.8365, 150.0987), (199.6525, 139.0987))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0010_00100694_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0014_00141710","images":["images/0014_00141710.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring a circular hole of diameter 101.37 mm. It is extruded to a thickness of 7.46 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6984379569613767\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(98.974407, 81.157389), (168.818203, 81.157389)], [(179.342611, 91.681797), (179.342611, 161.525593)], [(168.818203, 172.05), (98.974407, 172.05)], [(88.45, 161.525593), (88.45, 91.681797)], [(179.342611, 67.157389), (179.342611, 61.95)], [(179.342611, 67.157389), (168.818203, 67.157389)], [(179.342611, 61.95), (168.818203, 61.95), (98.974407, 61.95)], [(168.818203, 67.157389), (98.974407, 67.157389), (88.45, 67.157389), (88.45, 61.95)], [(98.974407, 61.95), (88.45, 61.95)], [(168.818203, 67.157389), (168.818203, 61.95)], [(98.974407, 67.157389), (98.974407, 61.95)], [(193.342611, 91.681797), (193.342611, 81.157389), (198.55, 81.157389)], [(198.55, 91.681797), (198.55, 81.157389)], [(193.342611, 172.05), (198.55, 172.05)], [(193.342611, 172.05), (193.342611, 161.525593)], [(198.55, 172.05), (198.55, 161.525593), (198.55, 91.681797)], [(193.342611, 161.525593), (193.342611, 91.681797), (198.55, 91.681797)], [(193.342611, 161.525593), (198.55, 161.525593)]])\nVISIBLE_CIRCLES = [(134.374687, 126.125313, 35.40028)]\nVISIBLE_ARCS = [(98.974407, 91.681797, 10.524408, 180.0, -90.0), (168.818203, 91.681797, 10.524408, -90.0, -0.0), (168.818203, 161.525593, 10.524408, -0.0, 90.0), (98.974407, 161.525593, 10.524408, 90.0, -180.0)]\nHIDDEN_SEGMENTS = [(169.775, 67.1574, 169.775, 61.95), (198.55, 90.725, 193.3426, 90.725)]\nDIMENSIONS = [('horizontal', '100', (98.9744, 81.1574), (168.8182, 81.1574), (133.8963, 92.1574)), ('vertical', '100', (179.3426, 91.6818), (179.3426, 161.5256), (168.3426, 126.6037)), ('diameter', '%%c101.37', (134.3747, 126.1253), 35.4003, 45), ('horizontal', '65.7534', (88.45, 126.1253), (134.3747, 126.1253), (111.4123, 137.1253)), ('vertical', '64.3836', (134.3747, 81.1574), (134.3747, 126.1253), (123.3747, 103.6413)), ('radius', 'R15.0685', (98.9744, 91.6818), 10.5244, 45), ('horizontal', '7.4558', (193.3426, 91.6818), (198.55, 91.6818), (195.9463, 102.6818))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0014_00141710_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0014_00143908","images":["images/0014_00143908.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 50.53 mm tall, featuring a polygonal cutout. It is extruded to a thickness of 1.04 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.976174825174823\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(184.800317, 149.169683), (184.800317, 99.847166), (87.182834, 99.847166), (87.182834, 149.169683), (184.800317, 149.169683)], [(93.348149, 118.34311), (101.568569, 118.34311)], [(184.800317, 84.830317), (184.800317, 85.847166)], [(87.182834, 84.830317), (87.182834, 85.847166), (184.800317, 85.847166)], [(87.182834, 84.830317), (184.800317, 84.830317)], [(199.817166, 99.847166), (198.800317, 99.847166), (198.800317, 149.169683)], [(199.817166, 149.169683), (198.800317, 149.169683)], [(199.817166, 99.847166), (199.817166, 149.169683)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(97.458359, 118.34311, 4.11021, -180.0, -0.0)]\nHIDDEN_SEGMENTS = [(93.3481, 84.8303, 93.3481, 85.8472), (101.5686, 84.8303, 101.5686, 85.8472), (199.8172, 118.3431, 198.8003, 118.3431), (198.8003, 114.2329, 199.8172, 114.2329)]\nDIMENSIONS = [('horizontal', '100', (184.8003, 99.8472), (87.1828, 99.8472), (135.9916, 88.8472)), ('vertical', '50.5263', (184.8003, 149.1697), (184.8003, 99.8472), (195.8003, 124.5084)), ('horizontal', '8.4211', (93.3482, 118.3432), (101.5685, 118.3432), (97.4583, 129.3432)), ('vertical', '0', (93.3482, 118.3432), (93.3482, 118.3432), (93.3482, 118.3432)), ('horizontal', '6.3158', (87.1828, 118.3432), (93.3482, 118.3432), (90.2655, 129.3432)), ('vertical', '31.5789', (93.3482, 149.1697), (93.3482, 118.3432), (104.3482, 133.7564)), ('radius', 'R4.2105', (97.4583, 118.3432), 4.1102, 45), ('horizontal', '1.0417', (199.8172, 149.1697), (198.8003, 149.1697), (199.3087, 138.1697))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0014_00143908_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0022_00220548","images":["images/0022_00220548.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 10 straight edges, featuring 4 circular holes, each of diameter 6.45 mm. It is extruded to a thickness of 61.06 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.39272504708098055\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(82.435075, 128.343503), (82.435075, 166.98258)], [(86.869068, 123.90951), (126.141572, 123.90951)], [(142.610687, 132.777495), (142.610687, 163.182015)], [(126.141572, 172.05), (86.869068, 172.05)], [(142.610687, 61.95), (140.710405, 61.95), (126.141572, 61.95), (86.869068, 61.95), (82.42453, 61.95)], [(142.610687, 109.90951), (140.710405, 109.90951), (126.141572, 109.90951), (86.869068, 109.90951), (82.42453, 109.90951)], [(142.610687, 109.90951), (142.610687, 61.95)], [(140.710405, 109.90951), (140.710405, 61.95)], [(86.869068, 109.90951), (86.869068, 61.95)], [(82.42453, 61.95), (82.42453, 109.90951)], [(126.141572, 109.90951), (126.141572, 61.95)], [(156.610687, 128.343503), (156.610687, 123.90951), (204.570198, 123.90951)], [(204.570198, 128.343503), (204.570198, 123.90951)], [(156.610687, 166.98258), (156.610687, 128.343503)], [(204.570198, 166.98258), (156.610687, 166.98258)], [(204.570198, 128.343503), (204.570198, 166.98258)], [(204.570198, 172.05), (204.570198, 166.98258)], [(156.610687, 172.05), (156.610687, 166.98258)], [(156.610687, 172.05), (204.570198, 172.05)], [(204.570198, 128.343503), (156.610687, 128.343503)]])\nVISIBLE_CIRCLES = [(86.869068, 128.343503, 1.266855), (86.869068, 166.98258, 1.266855), (126.141572, 128.343503, 1.266855), (126.141572, 166.98258, 1.266855)]\nVISIBLE_ARCS = [(86.869068, 128.343503, 4.433992, -180.0, -90.0), (126.061036, 147.617458, 23.708084, -89.805367, -51.836617), (137.767085, 132.823944, 4.843825, -52.580676, -0.549426), (137.767085, 163.135567, 4.843825, 0.549426, 52.580676), (126.061036, 148.342053, 23.708084, 51.836617, 89.805367), (87.185781, 167.299294, 4.761252, 93.814075, -176.185925)]\nHIDDEN_SEGMENTS = [(88.1359, 61.95, 88.1359, 109.9095), (127.4084, 61.95, 127.4084, 109.9095), (85.6022, 61.95, 85.6022, 109.9095), (124.8747, 61.95, 124.8747, 109.9095), (156.6107, 128.9769, 204.5702, 128.9769), (204.5702, 129.6104, 156.6107, 129.6104), (204.5702, 127.0766, 156.6107, 127.0766), (204.5702, 168.2494, 156.6107, 168.2494), (204.5702, 165.7157, 156.6107, 165.7157)]\nDIMENSIONS = [('horizontal', '100', (86.8691, 123.9095), (126.1416, 123.9095), (106.5053, 134.9095)), ('vertical', '77.4194', (142.6107, 132.7775), (142.6107, 163.182), (131.6107, 147.9798)), ('vertical', '98.3871', (82.4351, 166.9826), (82.4351, 128.3435), (93.4351, 147.663)), ('diameter', '%%c6.4516', (86.8691, 128.3435), 1.2669, 45), ('horizontal', '11.2903', (82.4351, 128.3435), (86.8691, 128.3435), (84.6521, 139.3435)), ('vertical', '11.2903', (86.8691, 123.9095), (86.8691, 128.3435), (75.8691, 126.1265)), ('diameter', '%%c6.4516', (86.8691, 166.9826), 1.2669, 45), ('horizontal', '11.2903', (82.4351, 166.9826), (86.8691, 166.9826), (84.6521, 177.9826)), ('vertical', '109.677', (86.8691, 123.9095), (86.8691, 166.9826), (75.8691, 145.446)), ('diameter', '%%c6.4516', (126.1416, 128.3435), 1.2669, 45), ('horizontal', '111.29', (82.4351, 128.3435), (126.1416, 128.3435), (104.2883, 139.3435)), ('vertical', '11.2903', (126.1416, 123.9095), (126.1416, 128.3435), (115.1416, 126.1265)), ('diameter', '%%c6.4516', (126.1416, 166.9826), 1.2669, 45), ('horizontal', '111.29', (82.4351, 166.9826), (126.1416, 166.9826), (104.2883, 177.9826)), ('vertical', '109.677', (126.1416, 123.9095), (126.1416, 166.9826), (115.1416, 145.446)), ('radius', 'R11.2903', (86.8691, 128.3435), 4.434, 135), ('radius', 'R60.3681', (126.061, 147.6175), 23.7081, 45), ('radius', 'R12.3339', (137.7671, 132.8239), 4.8438, 45), ('radius', 'R12.1236', (87.1858, 167.2993), 4.7612, 45), ('horizontal', '122.12', (156.6107, 128.3435), (204.5702, 128.3435), (180.5904, 139.3435))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0022_00220548_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00335191","images":["images/0033_00335191.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a square plate 100 x 100 mm. It is extruded to a thickness of 400 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1921999999999907\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(105.849158, 172.05), (107.67, 172.05), (107.67, 170.026842)], [(107.67, 154.650842), (107.67, 152.83), (100.993579, 152.83)], [(95.126421, 152.83), (88.45, 152.83), (88.45, 154.650842)], [(88.45, 170.026842), (88.45, 172.05), (90.473158, 172.05)], [(90.473158, 61.95), (90.473158, 138.83), (105.849158, 138.83)], [(105.849158, 61.95), (105.849158, 138.83)], [(90.473158, 61.95), (105.849158, 61.95)], [(105.849158, 138.83), (107.67, 138.83)], [(107.67, 61.95), (107.67, 138.83)], [(105.849158, 61.95), (107.67, 61.95)], [(88.45, 61.95), (88.45, 138.83), (90.473158, 138.83)], [(88.45, 61.95), (90.473158, 61.95)], [(198.55, 152.83), (121.67, 152.83), (121.67, 154.650842)], [(198.55, 154.650842), (121.67, 154.650842)], [(198.55, 152.83), (198.55, 154.650842)], [(121.67, 154.650842), (121.67, 170.026842)], [(198.55, 170.026842), (121.67, 170.026842)], [(198.55, 154.650842), (198.55, 170.026842)], [(121.67, 170.026842), (121.67, 172.05)], [(198.55, 172.05), (121.67, 172.05)], [(198.55, 170.026842), (198.55, 172.05)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(98.161158, 177.751809, 9.571623, -143.4375, -36.5625), (113.371809, 162.338842, 9.571623, 126.5625, -126.5625), (98.06, 152.83, 2.933579, -0.0, -180.0), (82.748191, 162.338842, 9.571623, -53.4375, 53.4375)]\nHIDDEN_SEGMENTS = [(100.9936, 61.95, 100.9936, 138.83), (95.1264, 61.95, 95.1264, 138.83), (103.8002, 138.83, 103.8002, 61.95), (92.3198, 138.83, 92.3198, 61.95), (121.67, 168.1802, 198.55, 168.1802), (121.67, 155.7636, 198.55, 155.7636)]\nDIMENSIONS = [('horizontal', '100', (107.67, 152.83), (88.45, 152.83), (98.06, 141.83)), ('vertical', '100', (107.67, 172.05), (107.67, 152.83), (118.67, 162.44)), ('radius', 'R49.8003', (98.1612, 177.7518), 9.5716, 45), ('radius', 'R15.2632', (98.06, 152.83), 2.9336, 45), ('horizontal', '400', (198.55, 172.05), (121.67, 172.05), (160.11, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00335191_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0043_00432241","images":["images/0043_00432241.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 42.71 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6734014598540302\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(96.8675, 172.050008), (96.8675, 104.709862)], [(96.8675, 90.709861), (97.91969, 90.709861), (98.971879, 90.709861), (100.024069, 90.709861), (101.076259, 90.709861), (102.128449, 90.709861), (103.180639, 90.709861), (104.232828, 90.709861), (105.285018, 90.709861), (106.337208, 90.709861), (107.389398, 90.709861), (108.441587, 90.709861), (109.493777, 90.709861), (110.545967, 90.709861), (111.598157, 90.709861), (112.650347, 90.709861), (113.702536, 90.709861), (114.754726, 90.709861), (115.806916, 90.709861), (116.859106, 90.709861), (117.911295, 90.709861), (118.963485, 90.709861), (120.015675, 90.709861), (121.067865, 90.709861), (122.120055, 90.709861), (123.172244, 90.709861), (124.224434, 90.709861), (125.276624, 90.709861), (126.328814, 90.709861), (127.381004, 90.709861), (128.433193, 90.709861), (129.485383, 90.709861), (130.537573, 90.709861)], [(96.8675, 61.950007), (97.91969, 61.950007), (98.971879, 61.950007), (100.024069, 61.950007), (101.076259, 61.950007), (102.128449, 61.950007), (103.180639, 61.950007), (104.232828, 61.950007), (105.285018, 61.950007), (106.337208, 61.950007), (107.389398, 61.950007), (108.441587, 61.950007), (109.493777, 61.950007), (110.545967, 61.950007), (111.598157, 61.950007), (112.650347, 61.950007), (113.702536, 61.950007), (114.754726, 61.950007), (115.806916, 61.950007), (116.859106, 61.950007), (117.911295, 61.950007), (118.963485, 61.950007), (120.015675, 61.950007), (121.067865, 61.950007), (122.120055, 61.950007), (123.172244, 61.950007), (124.224434, 61.950007), (125.276624, 61.950007), (126.328814, 61.950007), (127.381004, 61.950007), (128.433193, 61.950007), (129.485383, 61.950007), (130.537573, 61.950007)], [(96.8675, 90.709861), (96.8675, 61.950007)], [(130.537573, 61.950007), (130.537573, 90.709861)], [(173.297427, 172.050008), (144.537573, 172.050008)], [(173.297427, 104.709862), (144.537573, 104.709862)], [(144.537573, 172.050008), (144.537573, 104.709862)], [(173.297427, 172.050008), (173.297427, 104.709862)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(96.8675, 138.379935, 33.670073, -90.0, 90.0)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('vertical', '100', (96.8675, 172.05), (96.8675, 104.7099), (107.8675, 138.3799)), ('radius', 'R50', (96.8675, 138.3799), 33.6701, 45), ('horizontal', '42.7083', (173.2974, 172.05), (144.5376, 172.05), (158.9175, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0043_00432241_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0045_00459584","images":["images/0045_00459584.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 5 straight edges, featuring 2 circular holes (diameters 2.22, 4.44 mm). It is extruded to a thickness of 4.02 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.0200025256167178\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (94.420642, 90.321321, 201.537536, 205.636857, 115.298182, 110.974304, 177.597068, 140.424687, 77.132409, 86.980506, 187.537536, 144.955515, 108.420642, 77.440162, 77.747915, 78.055668)\nVISIBLE_SEGMENTS = _segments([[(C8, C1), (C13, C1), (C14, C1), (C15, C1), (78.363421, C1), (78.671174, C1), (78.978927, C1), (79.28668, C1), (79.594433, C1), (79.902186, C1), (80.209939, C1), (80.517692, C1), (80.825445, C1), (81.133198, C1), (81.440951, C1), (81.748704, C1), (82.056457, C1), (82.36421, C1), (82.671963, C1), (82.979716, C1), (83.28747, C1), (83.595223, C1), (83.902976, C1), (84.210729, C1), (84.518482, C1), (84.826235, C1), (85.133988, C1), (85.441741, C1), (85.749494, C1), (86.057247, C1), (86.365, C1), (86.672753, C1), (C9, C1), (C9, C0)], [(C8, C0), (C13, C0), (C14, C0), (C15, C0), (78.363421, C0), (78.671174, C0), (78.978927, C0), (79.28668, C0), (79.594433, C0), (79.902186, C0), (80.209939, C0), (80.517692, C0), (80.825445, C0), (81.133198, C0), (81.440951, C0), (81.748704, C0), (82.056457, C0), (82.36421, C0), (82.671963, C0), (82.979716, C0), (83.28747, C0), (83.595223, C0), (83.902976, C0), (84.210729, C0), (84.518482, C0), (84.826235, C0), (85.133988, C0), (85.441741, C0), (85.749494, C0), (86.057247, C0), (86.365, C0), (86.672753, C0), (C9, C0), (87.865433, C0), (88.750361, C0), (89.635288, C0), (90.520215, C0), (91.405143, C0), (92.29007, C0), (93.174997, C0), (94.059925, C0), (94.944852, C0), (95.82978, C0), (96.714707, C0), (97.599634, C0), (98.484562, C0), (99.369489, C0), (100.254416, C0), (101.139344, C0), (102.024271, C0), (102.909198, C0), (103.794126, C0), (104.679053, C0), (105.563981, C0), (106.448908, C0), (107.333835, C0), (108.218763, C0), (109.10369, C0), (109.988617, C0), (110.873545, C0), (111.758472, C0), (112.6434, C0), (113.528327, C0), (114.413254, C0), (C4, C0)], [(C4, C1), (C4, C0)], [(C9, C1), (87.865433, C1), (88.750361, C1), (89.635288, C1), (90.520215, C1), (91.405143, C1), (92.29007, C1), (93.174997, C1), (94.059925, C1), (94.944852, C1), (95.82978, C1), (96.714707, C1), (97.599634, C1), (98.484562, C1), (99.369489, C1), (100.254416, C1), (101.139344, C1), (102.024271, C1), (102.909198, C1), (103.794126, C1), (104.679053, C1), (105.563981, C1), (106.448908, C1), (107.333835, C1), (108.218763, C1), (109.10369, C1), (109.988617, C1), (110.873545, C1), (111.758472, C1), (112.6434, C1), (113.528327, C1), (114.413254, C1), (C4, C1)], [(C4, C0), (117.245022, C0), (119.191862, C0), (121.138702, C0), (123.085542, C0), (125.032383, C0), (126.979223, C0), (128.926063, C0), (130.872903, C0), (132.819744, C0), (134.766584, C0), (136.713424, C0), (138.660264, C0), (140.607104, C0), (142.553945, C0), (144.500785, C0), (146.447625, C0), (148.394465, C0), (150.341305, C0), (152.288146, C0), (154.234986, C0), (156.181826, C0), (158.128666, C0), (160.075507, C0), (162.022347, C0), (163.969187, C0), (165.916027, C0), (167.862867, C0), (169.809708, C0), (171.756548, C0), (173.703388, C0), (175.650228, C0), (C6, C0)], [(C6, C1), (C6, C0)], [(C4, C1), (117.245022, C1), (119.191862, C1), (121.138702, C1), (123.085542, C1), (125.032383, C1), (126.979223, C1), (128.926063, C1), (130.872903, C1), (132.819744, C1), (134.766584, C1), (136.713424, C1), (138.660264, C1), (140.607104, C1), (142.553945, C1), (144.500785, C1), (146.447625, C1), (148.394465, C1), (150.341305, C1), (152.288146, C1), (154.234986, C1), (156.181826, C1), (158.128666, C1), (160.075507, C1), (162.022347, C1), (163.969187, C1), (165.916027, C1), (167.862867, C1), (169.809708, C1), (171.756548, C1), (173.703388, C1), (175.650228, C1), (C6, C1), (177.907708, C1), (178.218348, C1), (178.528987, C1), (178.839627, C1), (179.150267, C1), (179.460906, C1), (179.771546, C1), (180.082185, C1), (180.392825, C1), (180.703465, C1), (181.014104, C1), (181.324744, C1), (181.635383, C1), (181.946023, C1), (182.256663, C1), (182.567302, C1), (182.877942, C1), (183.188581, C1), (183.499221, C1), (183.809861, C1), (184.1205, C1), (184.43114, C1), (184.74178, C1), (185.052419, C1), (185.363059, C1), (185.673698, C1), (185.984338, C1), (186.294978, C1), (186.605617, C1), (186.916257, C1), (187.226896, C1), (C10, C1)], [(C6, C0), (177.907708, C0), (178.218348, C0), (178.528987, C0), (178.839627, C0), (179.150267, C0), (179.460906, C0), (179.771546, C0), (180.082185, C0), (180.392825, C0), (180.703465, C0), (181.014104, C0), (181.324744, C0), (181.635383, C0), (181.946023, C0), (182.256663, C0), (182.567302, C0), (182.877942, C0), (183.188581, C0), (183.499221, C0), (183.809861, C0), (184.1205, C0), (184.43114, C0), (184.74178, C0), (185.052419, C0), (185.363059, C0), (185.673698, C0), (185.984338, C0), (186.294978, C0), (186.605617, C0), (186.916257, C0), (187.226896, C0), (C10, C0)], [(C8, C0), (C8, C1)], [(C10, C0), (C10, C1)], [(C3, C5), (C3, 111.894629), (C3, 112.814953), (C3, 113.735278), (C3, 114.655602), (C3, 115.575927), (C3, 116.496251), (C3, 117.416576), (C3, 118.3369), (C3, 119.257224), (C3, 120.177549), (C3, 121.097873), (C3, 122.018198), (C3, 122.938522), (C3, 123.858847), (C3, 124.779171), (C3, 125.699496), (C3, 126.61982), (C3, 127.540145), (C3, 128.460469), (C3, 129.380794), (C3, 130.301118), (C3, 131.221442), (C3, 132.141767), (C3, 133.062091), (C3, 133.982416), (C3, 134.90274), (C3, 135.823065), (C3, 136.743389), (C3, 137.663714), (C3, 138.584038), (C3, 139.504363), (C3, C7), (C2, C7)], [(C2, C5), (C2, 111.894629), (C2, 112.814953), (C2, 113.735278), (C2, 114.655602), (C2, 115.575927), (C2, 116.496251), (C2, 117.416576), (C2, 118.3369), (C2, 119.257224), (C2, 120.177549), (C2, 121.097873), (C2, 122.018198), (C2, 122.938522), (C2, 123.858847), (C2, 124.779171), (C2, 125.699496), (C2, 126.61982), (C2, 127.540145), (C2, 128.460469), (C2, 129.380794), (C2, 130.301118), (C2, 131.221442), (C2, 132.141767), (C2, 133.062091), (C2, 133.982416), (C2, 134.90274), (C2, 135.823065), (C2, 136.743389), (C2, 137.663714), (C2, 138.584038), (C2, 139.504363), (C2, C7)], [(C3, C5), (C2, C5)], [(C2, C7), (C2, 140.566276), (C2, 140.707864), (C2, 140.849452), (C2, 140.991041), (C2, 141.132629), (C2, 141.274217), (C2, 141.415806), (C2, 141.557394), (C2, 141.698983), (C2, 141.840571), (C2, 141.982159), (C2, 142.123748), (C2, 142.265336), (C2, 142.406924), (C2, 142.548513), (C2, 142.690101), (C2, 142.83169), (C2, 142.973278), (C2, 143.114866), (C2, 143.256455), (C2, 143.398043), (C2, 143.539631), (C2, 143.68122), (C2, 143.822808), (C2, 143.964397), (C2, 144.105985), (C2, 144.247573), (C2, 144.389162), (C2, 144.53075), (C2, 144.672339), (C2, 144.813927), (C2, C11)], [(C3, C11), (C2, C11)], [(C3, C7), (C3, 140.566276), (C3, 140.707864), (C3, 140.849452), (C3, 140.991041), (C3, 141.132629), (C3, 141.274217), (C3, 141.415806), (C3, 141.557394), (C3, 141.698983), (C3, 141.840571), (C3, 141.982159), (C3, 142.123748), (C3, 142.265336), (C3, 142.406924), (C3, 142.548513), (C3, 142.690101), (C3, 142.83169), (C3, 142.973278), (C3, 143.114866), (C3, 143.256455), (C3, 143.398043), (C3, 143.539631), (C3, 143.68122), (C3, 143.822808), (C3, 143.964397), (C3, 144.105985), (C3, 144.247573), (C3, 144.389162), (C3, 144.53075), (C3, 144.672339), (C3, 144.813927), (C3, C11)], [(C3, C12), (C3, 108.500444), (C3, 108.580246), (C3, 108.660048), (C3, 108.73985), (C3, 108.819652), (C3, 108.899454), (C3, 108.979256), (C3, 109.059058), (C3, 109.13886), (C3, 109.218662), (C3, 109.298464), (C3, 109.378266), (C3, 109.458068), (C3, 109.537869), (C3, 109.617671), (C3, 109.697473), (C3, 109.777275), (C3, 109.857077), (C3, 109.936879), (C3, 110.016681), (C3, 110.096483), (C3, 110.176285), (C3, 110.256087), (C3, 110.335889), (C3, 110.415691), (C3, 110.495493), (C3, 110.575295), (C3, 110.655097), (C3, 110.734898), (C3, 110.8147), (C3, 110.894502), (C3, C5)], [(C2, C12), (C2, 108.500444), (C2, 108.580246), (C2, 108.660048), (C2, 108.73985), (C2, 108.819652), (C2, 108.899454), (C2, 108.979256), (C2, 109.059058), (C2, 109.13886), (C2, 109.218662), (C2, 109.298464), (C2, 109.378266), (C2, 109.458068), (C2, 109.537869), (C2, 109.617671), (C2, 109.697473), (C2, 109.777275), (C2, 109.857077), (C2, 109.936879), (C2, 110.016681), (C2, 110.096483), (C2, 110.176285), (C2, 110.256087), (C2, 110.335889), (C2, 110.415691), (C2, 110.495493), (C2, 110.575295), (C2, 110.655097), (C2, 110.734898), (C2, 110.8147), (C2, 110.894502), (C2, C5)], [(C2, C12), (C3, C12)]])\nVISIBLE_CIRCLES = [(89.24592, 124.566789, 2.265414), (131.15608, 112.107011, 1.132707)]\nVISIBLE_ARCS = [(99.048737, 122.130338, 21.916328, 123.411633, -149.400867), (104.341834, 153.605371, 21.797848, -142.794307, -59.825557), (134.948568, 210.130352, 77.888728, -104.612941, -56.800441), (167.928844, 127.896024, 19.608692, -43.604281, 60.458219), (120.59644, 429.462581, 321.041938, -97.231473, -78.950223)]\nHIDDEN_SEGMENTS = [(80.1843, 90.3213, 80.1843, 94.4206), (182.1279, 90.3213, 182.1279, 94.4206), (91.5113, 90.3213, 91.5113, 94.4206), (132.2888, 90.3213, 132.2888, 94.4206), (130.0234, 94.4206, 130.0234, 90.3213), (205.6369, 134.7611, 201.5375, 134.7611), (205.6369, 114.3724, 201.5375, 114.3724), (201.5375, 131.8075, 205.6369, 131.8075), (201.5375, 132.2416, 205.6369, 132.2416), (201.5375, 122.3014, 205.6369, 122.3014), (201.5375, 126.8322, 205.6369, 126.8322), (201.5375, 113.2397, 205.6369, 113.2397)]\nDIMENSIONS = [('diameter', '%%c4.442', (89.246, 124.5668), 2.2654, 45), ('horizontal', '8.884', (80.1843, 124.5668), (89.246, 124.5668), (84.7151, 135.5668)), ('vertical', '19.9889', (89.246, 144.9555), (89.246, 124.5668), (100.246, 134.7611)), ('diameter', '%%c2.221', (131.156, 112.107), 1.1327, 45), ('horizontal', '49.9722', (80.1843, 112.107), (131.156, 112.107), (105.6701, 123.107)), ('vertical', '32.2043', (131.156, 144.9555), (131.156, 112.107), (142.156, 128.5313)), ('radius', 'R21.4865', (99.0487, 122.1303), 21.9163, 45), ('radius', 'R21.3704', (104.3418, 153.6053), 21.7979, 45), ('radius', 'R76.3613', (134.9486, 210.1303), 77.8887, 45), ('radius', 'R19.2242', (167.9288, 127.8961), 19.6087, 45), ('radius', 'R314.746', (120.5964, 429.4626), 321.0419, 45), ('horizontal', '4.0189', (205.6369, 110.9743), (201.5376, 110.9743), (203.5872, 99.9743))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0045_00459584_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0048_00489155","images":["images/0048_00489155.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 2 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.4405882352941177\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(207.08882, 130.748059), (207.08882, 106.485521)], [(78.194083, 144.395737), (191.924733, 144.395737)], [(63.029996, 106.485521), (63.029996, 130.748059)], [(63.029996, 106.485521), (207.08882, 106.485521)], [(207.08882, 92.485521), (207.08882, 89.604344)], [(207.08882, 92.485521), (206.614942, 92.485521), (206.141064, 92.485521), (205.667187, 92.485521), (205.193309, 92.485521), (204.719431, 92.485521), (204.245553, 92.485521), (203.771676, 92.485521), (203.297798, 92.485521), (202.82392, 92.485521), (202.350043, 92.485521), (201.876165, 92.485521), (201.402287, 92.485521), (200.928409, 92.485521), (200.454532, 92.485521), (199.980654, 92.485521), (199.506776, 92.485521), (199.032899, 92.485521), (198.559021, 92.485521), (198.085143, 92.485521), (197.611266, 92.485521), (197.137388, 92.485521), (196.66351, 92.485521), (196.189632, 92.485521), (195.715755, 92.485521), (195.241877, 92.485521), (194.767999, 92.485521), (194.294122, 92.485521), (193.820244, 92.485521), (193.346366, 92.485521), (192.872488, 92.485521), (192.398611, 92.485521), (191.924733, 92.485521), (191.924733, 89.604344)], [(207.08882, 89.604344), (206.614942, 89.604344), (206.141064, 89.604344), (205.667187, 89.604344), (205.193309, 89.604344), (204.719431, 89.604344), (204.245553, 89.604344), (203.771676, 89.604344), (203.297798, 89.604344), (202.82392, 89.604344), (202.350043, 89.604344), (201.876165, 89.604344), (201.402287, 89.604344), (200.928409, 89.604344), (200.454532, 89.604344), (199.980654, 89.604344), (199.506776, 89.604344), (199.032899, 89.604344), (198.559021, 89.604344), (198.085143, 89.604344), (197.611266, 89.604344), (197.137388, 89.604344), (196.66351, 89.604344), (196.189632, 89.604344), (195.715755, 89.604344), (195.241877, 89.604344), (194.767999, 89.604344), (194.294122, 89.604344), (193.820244, 89.604344), (193.346366, 89.604344), (192.872488, 89.604344), (192.398611, 89.604344), (191.924733, 89.604344)], [(78.194083, 89.604344), (191.924733, 89.604344)], [(78.194083, 92.485521), (78.194083, 89.604344)], [(191.924733, 92.485521), (78.194083, 92.485521), (77.720205, 92.485521), (77.246327, 92.485521), (76.77245, 92.485521), (76.298572, 92.485521), (75.824694, 92.485521), (75.350817, 92.485521), (74.876939, 92.485521), (74.403061, 92.485521), (73.929183, 92.485521), (73.455306, 92.485521), (72.981428, 92.485521), (72.50755, 92.485521), (72.033673, 92.485521), (71.559795, 92.485521), (71.085917, 92.485521), (70.61204, 92.485521), (70.138162, 92.485521), (69.664284, 92.485521), (69.190406, 92.485521), (68.716529, 92.485521), (68.242651, 92.485521), (67.768773, 92.485521), (67.294896, 92.485521), (66.821018, 92.485521), (66.34714, 92.485521), (65.873262, 92.485521), (65.399385, 92.485521), (64.925507, 92.485521), (64.451629, 92.485521), (63.977752, 92.485521), (63.503874, 92.485521), (63.029996, 92.485521), (63.029996, 89.604344)], [(78.194083, 89.604344), (77.720205, 89.604344), (77.246327, 89.604344), (76.77245, 89.604344), (76.298572, 89.604344), (75.824694, 89.604344), (75.350817, 89.604344), (74.876939, 89.604344), (74.403061, 89.604344), (73.929183, 89.604344), (73.455306, 89.604344), (72.981428, 89.604344), (72.50755, 89.604344), (72.033673, 89.604344), (71.559795, 89.604344), (71.085917, 89.604344), (70.61204, 89.604344), (70.138162, 89.604344), (69.664284, 89.604344), (69.190406, 89.604344), (68.716529, 89.604344), (68.242651, 89.604344), (67.768773, 89.604344), (67.294896, 89.604344), (66.821018, 89.604344), (66.34714, 89.604344), (65.873262, 89.604344), (65.399385, 89.604344), (64.925507, 89.604344), (64.451629, 89.604344), (63.977752, 89.604344), (63.503874, 89.604344), (63.029996, 89.604344)], [(221.08882, 144.395737), (223.969996, 144.395737)], [(221.08882, 144.395737), (221.08882, 143.969247), (221.08882, 143.542758), (221.08882, 143.116268), (221.08882, 142.689778), (221.08882, 142.263288), (221.08882, 141.836798), (221.08882, 141.410308), (221.08882, 140.983818), (221.08882, 140.557328), (221.08882, 140.130838), (221.08882, 139.704348), (221.08882, 139.277858), (221.08882, 138.851368), (221.08882, 138.424878), (221.08882, 137.998388), (221.08882, 137.571898), (221.08882, 137.145408), (221.08882, 136.718919), (221.08882, 136.292429), (221.08882, 135.865939), (221.08882, 135.439449), (221.08882, 135.012959), (221.08882, 134.586469), (221.08882, 134.159979), (221.08882, 133.733489), (221.08882, 133.306999), (221.08882, 132.880509), (221.08882, 132.454019), (221.08882, 132.027529), (221.08882, 131.601039), (221.08882, 131.174549), (221.08882, 130.748059), (223.969996, 130.748059)], [(223.969996, 144.395737), (223.969996, 143.969247), (223.969996, 143.542758), (223.969996, 143.116268), (223.969996, 142.689778), (223.969996, 142.263288), (223.969996, 141.836798), (223.969996, 141.410308), (223.969996, 140.983818), (223.969996, 140.557328), (223.969996, 140.130838), (223.969996, 139.704348), (223.969996, 139.277858), (223.969996, 138.851368), (223.969996, 138.424878), (223.969996, 137.998388), (223.969996, 137.571898), (223.969996, 137.145408), (223.969996, 136.718919), (223.969996, 136.292429), (223.969996, 135.865939), (223.969996, 135.439449), (223.969996, 135.012959), (223.969996, 134.586469), (223.969996, 134.159979), (223.969996, 133.733489), (223.969996, 133.306999), (223.969996, 132.880509), (223.969996, 132.454019), (223.969996, 132.027529), (223.969996, 131.601039), (223.969996, 131.174549), (223.969996, 130.748059)], [(223.969996, 106.485521), (223.969996, 130.748059)], [(221.08882, 106.485521), (223.969996, 106.485521)], [(221.08882, 130.748059), (221.08882, 106.485521)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(190.53805, 127.606647, 16.846259, 10.747163, 85.278413), (79.580766, 127.606647, 16.846259, 94.721587, 169.252837)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '78.9474', (191.9248, 144.3958), (78.1941, 144.3958), (135.0594, 133.3958)), ('horizontal', '100', (63.03, 106.4855), (207.0888, 106.4855), (135.0594, 117.4855)), ('vertical', '16.8421', (207.0888, 106.4855), (207.0888, 130.7481), (196.0888, 118.6168)), ('radius', 'R11.694', (190.538, 127.6066), 16.8462, 45), ('horizontal', '2', (221.0888, 106.4855), (223.97, 106.4855), (222.5294, 117.4855))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0048_00489155_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0053_00535751","images":["images/0053_00535751.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 4 straight edges, featuring 2 circular holes, each of diameter 8.7 mm. It is extruded to a thickness of 1.4 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8202664846910602\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (169.186103, 166.894979, 66.946621, 64.655498, 86.194898, 165.612473, 152.55453, 132.030887, 117.533868, 174.755498, 80.946621, 152.894979, 117.9869, 118.439932, 118.892963, 119.345995)\nVISIBLE_SEGMENTS = _segments([[(138.277213, C4), (117.75357, C5)], [(C7, 169.181802), (C6, 90.65656)], [(C8, C3), (C12, C3), (C13, C3), (C14, C3), (C15, C3), (119.799027, C3), (120.252059, C3), (120.705091, C3), (121.158123, C3), (121.611155, C3), (122.064186, C3), (122.517218, C3), (122.97025, C3), (123.423282, C3), (123.876314, C3), (124.329346, C3), (124.782377, C3), (125.235409, C3), (125.688441, C3), (126.141473, C3), (126.594505, C3), (127.047537, C3), (127.500569, C3), (127.9536, C3), (128.406632, C3), (128.859664, C3), (129.312696, C3), (129.765728, C3), (130.21876, C3), (130.671791, C3), (131.124823, C3), (131.577855, C3), (C7, C3), (C7, C2)], [(C8, C2), (C12, C2), (C13, C2), (C14, C2), (C15, C2), (119.799027, C2), (120.252059, C2), (120.705091, C2), (121.158123, C2), (121.611155, C2), (122.064186, C2), (122.517218, C2), (122.97025, C2), (123.423282, C2), (123.876314, C2), (124.329346, C2), (124.782377, C2), (125.235409, C2), (125.688441, C2), (126.141473, C2), (126.594505, C2), (127.047537, C2), (127.500569, C2), (127.9536, C2), (128.406632, C2), (128.859664, C2), (129.312696, C2), (129.765728, C2), (130.21876, C2), (130.671791, C2), (131.124823, C2), (131.577855, C2), (C7, C2), (C6, C2)], [(C6, C3), (C6, C2)], [(C7, C3), (C6, C3)], [(C6, C2), (152.565169, C2), (152.575808, C2), (152.586447, C2), (152.597086, C2), (152.607725, C2), (152.618364, C2), (152.629003, C2), (152.639642, C2), (152.650281, C2), (152.66092, C2), (152.671559, C2), (152.682198, C2), (152.692837, C2), (152.703476, C2), (152.714115, C2), (152.724754, C2), (152.735393, C2), (152.746032, C2), (152.756671, C2), (152.767311, C2), (152.77795, C2), (152.788589, C2), (152.799228, C2), (152.809867, C2), (152.820506, C2), (152.831145, C2), (152.841784, C2), (152.852423, C2), (152.863062, C2), (152.873701, C2), (152.88434, C2), (C11, C2)], [(C8, C2), (C8, C3)], [(C11, C2), (C11, C3)], [(C0, C5), (C0, 165.898192), (C0, 166.183912), (C0, 166.469631), (C0, 166.755351), (C0, 167.04107), (C0, 167.32679), (C0, 167.612509), (C0, 167.898229), (C0, 168.183949), (C0, 168.469668), (C0, 168.755388), (C0, 169.041107), (C0, 169.326827), (C0, 169.612546), (C0, 169.898266), (C0, 170.183985), (C0, 170.469705), (C0, 170.755424), (C0, 171.041144), (C0, 171.326863), (C0, 171.612583), (C0, 171.898303), (C0, 172.184022), (C0, 172.469742), (C0, 172.755461), (C0, 173.041181), (C0, 173.3269), (C0, 173.61262), (C0, 173.898339), (C0, 174.184059), (C0, 174.469778), (C0, C9)], [(C1, C5), (C1, 165.898192), (C1, 166.183912), (C1, 166.469631), (C1, 166.755351), (C1, 167.04107), (C1, 167.32679), (C1, 167.612509), (C1, 167.898229), (C1, 168.183949), (C1, 168.469668), (C1, 168.755388), (C1, 169.041107), (C1, 169.326827), (C1, 169.612546), (C1, 169.898266), (C1, 170.183985), (C1, 170.469705), (C1, 170.755424), (C1, 171.041144), (C1, 171.326863), (C1, 171.612583), (C1, 171.898303), (C1, 172.184022), (C1, 172.469742), (C1, 172.755461), (C1, 173.041181), (C1, 173.3269), (C1, 173.61262), (C1, 173.898339), (C1, 174.184059), (C1, 174.469778), (C1, C9)], [(C1, C4), (C0, C4)], [(C1, C4), (C1, C5)], [(C0, C4), (C0, C5)], [(C1, C10), (C1, 81.11063), (C1, 81.274639), (C1, 81.438647), (C1, 81.602656), (C1, 81.766665), (C1, 81.930673), (C1, 82.094682), (C1, 82.258691), (C1, 82.422699), (C1, 82.586708), (C1, 82.750717), (C1, 82.914725), (C1, 83.078734), (C1, 83.242742), (C1, 83.406751), (C1, 83.57076), (C1, 83.734768), (C1, 83.898777), (C1, 84.062786), (C1, 84.226794), (C1, 84.390803), (C1, 84.554812), (C1, 84.71882), (C1, 84.882829), (C1, 85.046838), (C1, 85.210846), (C1, 85.374855), (C1, 85.538864), (C1, 85.702872), (C1, 85.866881), (C1, 86.030889), (C1, C4)], [(C0, C10), (C0, 81.11063), (C0, 81.274639), (C0, 81.438647), (C0, 81.602656), (C0, 81.766665), (C0, 81.930673), (C0, 82.094682), (C0, 82.258691), (C0, 82.422699), (C0, 82.586708), (C0, 82.750717), (C0, 82.914725), (C0, 83.078734), (C0, 83.242742), (C0, 83.406751), (C0, 83.57076), (C0, 83.734768), (C0, 83.898777), (C0, 84.062786), (C0, 84.226794), (C0, 84.390803), (C0, 84.554812), (C0, 84.71882), (C0, 84.882829), (C0, 85.046838), (C0, 85.210846), (C0, 85.374855), (C0, 85.538864), (C0, 85.702872), (C0, 85.866881), (C0, 86.030889), (C0, C4)], [(C1, C9), (C0, C9)], [(C1, C10), (C0, C10)], [(C1, C5), (C0, C5)]])\nVISIBLE_CIRCLES = [(124.892229, 167.397137, 3.569329), (145.415871, 87.979563, 3.569329)]\nVISIBLE_ARCS = [(124.892229, 167.397137, 7.358361, 14.036243, -165.963757), (145.415871, 88.425729, 7.479108, -162.645975, 17.354025), (142.247114, -8.540802, 73.942557, 81.723241, 81.984382)]\nHIDDEN_SEGMENTS = [(138.2772, 66.9466, 138.2772, 64.6555), (128.4615, 66.9466, 128.4615, 64.6555), (148.9852, 66.9466, 148.9852, 64.6555), (121.3229, 66.9466, 121.3229, 64.6555), (141.8465, 66.9466, 141.8465, 64.6555), (169.1861, 169.1818, 166.895, 169.1818), (169.1861, 90.6566, 166.895, 90.6566), (166.895, 163.8278, 169.1861, 163.8278), (166.895, 170.9665, 169.1861, 170.9665), (166.895, 84.4102, 169.1861, 84.4102), (166.895, 91.5489, 169.1861, 91.5489)]\nDIMENSIONS = [('aligned', '98.9471', (132.0308, 169.1818), (152.5545, 90.6566), (152.9352, 132.7007)), ('aligned', '100', (138.2772, 86.1949), (117.7535, 165.6125), (117.3652, 123.1514)), ('diameter', '%%c8.7029', (124.8922, 167.3971), 3.5693, 45), ('horizontal', '8.7029', (117.7535, 167.3971), (124.8922, 167.3971), (121.3229, 178.3971)), ('vertical', '2.1757', (124.8922, 169.1818), (124.8922, 167.3971), (135.8922, 168.2894)), ('diameter', '%%c8.7029', (145.4159, 87.9796), 3.5693, 45), ('horizontal', '33.7236', (117.7535, 87.9796), (145.4159, 87.9796), (131.5847, 98.9796)), ('vertical', '98.9949', (145.4159, 169.1818), (145.4159, 87.9796), (156.4159, 128.5807)), ('radius', 'R8.9707', (124.8922, 167.3971), 7.3584, 135), ('radius', 'R9.1179', (145.4159, 88.4257), 7.4791, 135), ('horizontal', '2.7931', (169.1861, 165.6125), (166.8949, 165.6125), (168.0405, 154.6125))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0053_00535751_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00621194","images":["images/0062_00621194.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 25.26 mm wide and 100 mm tall, featuring a circular hole of diameter 12.63 mm. It is extruded to a thickness of 12.5 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8542222222222222\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(111.2668, 172.05002), (89.686449, 172.05002), (89.686449, 86.627798), (111.2668, 86.627798)], [(153.977911, 72.627798), (152.643189, 72.627798), (151.308467, 72.627798), (149.973744, 72.627798), (148.639022, 72.627798), (147.3043, 72.627798), (145.969578, 72.627798), (144.634856, 72.627798), (143.300133, 72.627798), (141.965411, 72.627798), (140.630689, 72.627798), (139.295967, 72.627798), (137.961244, 72.627798), (136.626522, 72.627798), (135.2918, 72.627798), (133.957078, 72.627798), (132.622356, 72.627798), (131.287633, 72.627798), (129.952911, 72.627798), (128.618189, 72.627798), (127.283467, 72.627798), (125.948744, 72.627798), (124.614022, 72.627798), (123.2793, 72.627798), (121.944578, 72.627798), (120.609856, 72.627798), (119.275133, 72.627798), (117.940411, 72.627798), (116.605689, 72.627798), (115.270967, 72.627798), (113.936244, 72.627798), (112.601522, 72.627798), (111.2668, 72.627798)], [(153.977911, 61.95002), (152.643189, 61.95002), (151.308467, 61.95002), (149.973744, 61.95002), (148.639022, 61.95002), (147.3043, 61.95002), (145.969578, 61.95002), (144.634856, 61.95002), (143.300133, 61.95002), (141.965411, 61.95002), (140.630689, 61.95002), (139.295967, 61.95002), (137.961244, 61.95002), (136.626522, 61.95002), (135.2918, 61.95002), (133.957078, 61.95002), (132.622356, 61.95002), (131.287633, 61.95002), (129.952911, 61.95002), (128.618189, 61.95002), (127.283467, 61.95002), (125.948744, 61.95002), (124.614022, 61.95002), (123.2793, 61.95002), (121.944578, 61.95002), (120.609856, 61.95002), (119.275133, 61.95002), (117.940411, 61.95002), (116.605689, 61.95002), (115.270967, 61.95002), (113.936244, 61.95002), (112.601522, 61.95002), (111.2668, 61.95002), (89.686449, 61.95002)], [(89.686449, 72.627798), (89.686449, 61.95002)], [(111.2668, 72.627798), (89.686449, 72.627798)], [(153.977911, 61.95002), (153.977911, 72.627798)], [(111.2668, 72.627798), (111.2668, 61.95002)], [(167.977911, 172.05002), (178.655689, 172.05002), (178.655689, 86.627798)], [(167.977911, 86.627798), (178.655689, 86.627798)], [(167.977911, 172.05002), (167.977911, 86.627798)]])\nVISIBLE_CIRCLES = [(111.2668, 129.7885, 5.395088)]\nVISIBLE_ARCS = [(111.2668, 129.338909, 42.711111, -90.0, 90.0)]\nHIDDEN_SEGMENTS = [(116.6618, 72.6278, 116.6618, 61.95), (105.8716, 61.95, 105.8716, 72.6278), (178.6556, 135.1836, 167.9778, 135.1836), (178.6556, 124.3934, 167.9778, 124.3934)]\nDIMENSIONS = [('horizontal', '25.2632', (111.2668, 172.05), (89.6864, 172.05), (100.4766, 161.05)), ('vertical', '100', (111.2668, 86.6278), (111.2668, 172.05), (100.2668, 129.3389)), ('diameter', '%%c12.6316', (111.2668, 129.7885), 5.3951, 45), ('horizontal', '25.2632', (89.6864, 129.7885), (111.2668, 129.7885), (100.4766, 140.7885)), ('vertical', '50.5263', (111.2668, 86.6278), (111.2668, 129.7885), (100.2668, 108.2081)), ('radius', 'R50', (111.2668, 129.3389), 42.7111, 135), ('horizontal', '12.5', (167.9778, 86.6278), (178.6556, 86.6278), (173.3167, 97.6278))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00621194_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00625681","images":["images/0062_00625681.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 12 straight edges, featuring a circular hole of diameter 116 mm. It is extruded to a thickness of 35.04 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.33468229499042496\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (74.871984, 63.146197, 202.33902, 190.613233, 147.108189, 158.426799, 103.102405, 117.990086, 108.284052, 119.602663, 84.66094, 141.926541, 176.613233, 175.89766, 173.246197, 168.461463)\nVISIBLE_SEGMENTS = _segments([[(113.779042, 99.548622), (146.779558, 100.519225)], [(C5, 118.96069), (140.955937, C4)], [(C9, C4), (C6, C7)], [(C10, C0), (84.638578, C0), (84.616217, C0), (84.593855, C0), (84.571493, C0), (84.549132, C0), (84.52677, C0), (84.504408, C0), (84.482047, C0), (84.459685, C0), (84.437323, C0), (84.414962, C0), (84.3926, C0), (84.370238, C0), (84.347877, C0), (84.325515, C0), (84.303153, C0), (84.280792, C0), (84.25843, C0), (84.236069, C0), (84.213707, C0), (84.191345, C0), (84.168984, C0), (84.146622, C0), (84.12426, C0), (84.101899, C0), (84.079537, C0), (84.057175, C0), (84.034814, C0), (84.012452, C0), (83.99009, C0), (83.967729, C0), (83.945367, C0)], [(C10, C0), (C10, C1)], [(C12, C0), (176.590871, C0), (176.56851, C0), (176.546148, C0), (176.523786, C0), (176.501425, C0), (176.479063, C0), (176.456701, C0), (176.43434, C0), (176.411978, C0), (176.389616, C0), (176.367255, C0), (176.344893, C0), (176.322531, C0), (176.30017, C0), (176.277808, C0), (176.255447, C0), (176.233085, C0), (176.210723, C0), (176.188362, C0), (176.166, C0), (176.143638, C0), (176.121277, C0), (176.098915, C0), (176.076553, C0), (176.054192, C0), (176.03183, C0), (176.009468, C0), (175.987107, C0), (175.964745, C0), (175.942383, C0), (175.920022, C0), (C13, C0), (C13, C1)], [(C12, C1), (176.590871, C1), (176.56851, C1), (176.546148, C1), (176.523786, C1), (176.501425, C1), (176.479063, C1), (176.456701, C1), (176.43434, C1), (176.411978, C1), (176.389616, C1), (176.367255, C1), (176.344893, C1), (176.322531, C1), (176.30017, C1), (176.277808, C1), (176.255447, C1), (176.233085, C1), (176.210723, C1), (176.188362, C1), (176.166, C1), (176.143638, C1), (176.121277, C1), (176.098915, C1), (176.076553, C1), (176.054192, C1), (176.03183, C1), (176.009468, C1), (175.987107, C1), (175.964745, C1), (175.942383, C1), (175.920022, C1), (C13, C1), (175.351696, C1), (174.805731, C1), (174.259767, C1), (173.713802, C1), (173.167838, C1), (172.621874, C1), (172.075909, C1), (171.529945, C1), (170.98398, C1), (170.438016, C1), (169.892052, C1), (169.346087, C1), (168.800123, C1), (168.254158, C1), (167.708194, C1), (167.162229, C1), (166.616265, C1), (166.070301, C1), (165.524336, C1), (164.978372, C1), (164.432407, C1), (163.886443, C1), (163.340479, C1), (162.794514, C1), (162.24855, C1), (161.702585, C1), (161.156621, C1), (160.610656, C1), (160.064692, C1), (159.518728, C1), (158.972763, C1), (C5, C1)], [(C5, C0), (C5, C1)], [(C13, C0), (175.351696, C0), (174.805731, C0), (174.259767, C0), (173.713802, C0), (173.167838, C0), (172.621874, C0), (172.075909, C0), (171.529945, C0), (170.98398, C0), (170.438016, C0), (169.892052, C0), (169.346087, C0), (168.800123, C0), (168.254158, C0), (167.708194, C0), (167.162229, C0), (166.616265, C0), (166.070301, C0), (165.524336, C0), (164.978372, C0), (164.432407, C0), (163.886443, C0), (163.340479, C0), (162.794514, C0), (162.24855, C0), (161.702585, C0), (161.156621, C0), (160.610656, C0), (160.064692, C0), (159.518728, C0), (158.972763, C0), (C5, C0)], [(C5, C1), (C11, C1)], [(C5, C0), (C11, C0), (C11, C1)], [(C11, C0), (141.22892, C0), (140.531298, C0), (139.833677, C0), (139.136056, C0), (138.438435, C0), (137.740814, C0), (137.043192, C0), (136.345571, C0), (135.64795, C0), (134.950329, C0), (134.252708, C0), (133.555086, C0), (132.857465, C0), (132.159844, C0), (131.462223, C0), (130.764602, C0), (130.066981, C0), (129.369359, C0), (128.671738, C0), (127.974117, C0), (127.276496, C0), (126.578875, C0), (125.881253, C0), (125.183632, C0), (124.486011, C0), (123.78839, C0), (123.090769, C0), (122.393147, C0), (121.695526, C0), (120.997905, C0), (120.300284, C0), (C9, C0), (C9, C1)], [(C11, C1), (141.22892, C1), (140.531298, C1), (139.833677, C1), (139.136056, C1), (138.438435, C1), (137.740814, C1), (137.043192, C1), (136.345571, C1), (135.64795, C1), (134.950329, C1), (134.252708, C1), (133.555086, C1), (132.857465, C1), (132.159844, C1), (131.462223, C1), (130.764602, C1), (130.066981, C1), (129.369359, C1), (128.671738, C1), (127.974117, C1), (127.276496, C1), (126.578875, C1), (125.881253, C1), (125.183632, C1), (124.486011, C1), (123.78839, C1), (123.090769, C1), (122.393147, C1), (121.695526, C1), (120.997905, C1), (120.300284, C1), (C9, C1), (C6, C1)], [(C6, C0), (C6, C1)], [(C9, C0), (C6, C0)], [(C6, C1), (102.526109, C1), (101.949813, C1), (101.373517, C1), (100.797222, C1), (100.220926, C1), (99.64463, C1), (99.068334, C1), (98.492038, C1), (97.915743, C1), (97.339447, C1), (96.763151, C1), (96.186855, C1), (95.61056, C1), (95.034264, C1), (94.457968, C1), (93.881672, C1), (93.305376, C1), (92.729081, C1), (92.152785, C1), (91.576489, C1), (91.000193, C1), (90.423898, C1), (89.847602, C1), (89.271306, C1), (88.69501, C1), (88.118715, C1), (87.542419, C1), (86.966123, C1), (86.389827, C1), (85.813531, C1), (85.237236, C1), (C10, C1)], [(C6, C0), (102.526109, C0), (101.949813, C0), (101.373517, C0), (100.797222, C0), (100.220926, C0), (99.64463, C0), (99.068334, C0), (98.492038, C0), (97.915743, C0), (97.339447, C0), (96.763151, C0), (96.186855, C0), (95.61056, C0), (95.034264, C0), (94.457968, C0), (93.881672, C0), (93.305376, C0), (92.729081, C0), (92.152785, C0), (91.576489, C0), (91.000193, C0), (90.423898, C0), (89.847602, C0), (89.271306, C0), (88.69501, C0), (88.118715, C0), (87.542419, C0), (86.966123, C0), (86.389827, C0), (85.813531, C0), (85.237236, C0), (C10, C0)], [(83.945367, C1), (83.945367, C0)], [(C12, C1), (C12, C0)], [(C3, C8), (C3, 107.677425), (C3, 107.070798), (C3, 106.464171), (C3, 105.857544), (C3, 105.250917), (C3, 104.64429), (C3, 104.037662), (C3, 103.431035), (C3, 102.824408), (C3, 102.217781), (C3, 101.611154), (C3, 101.004527), (C3, 100.3979), (C3, 99.791273), (C3, 99.184645), (C3, 98.578018), (C3, 97.971391), (C3, 97.364764), (C3, 96.758137), (C3, 96.15151), (C3, 95.544883), (C3, 94.938255), (C3, 94.331628), (C3, 93.725001), (C3, 93.118374), (C3, 92.511747), (C3, 91.90512), (C3, 91.298493), (C3, 90.691866), (C3, 90.085238), (C3, 89.478611), (C3, 88.871984), (C2, 88.871984)], [(C2, C8), (C2, 107.677425), (C2, 107.070798), (C2, 106.464171), (C2, 105.857544), (C2, 105.250917), (C2, 104.64429), (C2, 104.037662), (C2, 103.431035), (C2, 102.824408), (C2, 102.217781), (C2, 101.611154), (C2, 101.004527), (C2, 100.3979), (C2, 99.791273), (C2, 99.184645), (C2, 98.578018), (C2, 97.971391), (C2, 97.364764), (C2, 96.758137), (C2, 96.15151), (C2, 95.544883), (C2, 94.938255), (C2, 94.331628), (C2, 93.725001), (C2, 93.118374), (C2, 92.511747), (C2, 91.90512), (C2, 91.298493), (C2, 90.691866), (C2, 90.085238), (C2, 89.478611), (C2, 88.871984)], [(C3, C8), (C2, C8)], [(C3, C14), (C3, 173.096674), (C3, 172.947152), (C3, 172.797629), (C3, 172.648106), (C3, 172.498583), (C3, 172.34906), (C3, 172.199537), (C3, 172.050014), (C3, 171.900491), (C3, 171.750968), (C3, 171.601445), (C3, 171.451922), (C3, 171.302399), (C3, 171.152876), (C3, 171.003353), (C3, 170.85383), (C3, 170.704308), (C3, 170.554785), (C3, 170.405262), (C3, 170.255739), (C3, 170.106216), (C3, 169.956693), (C3, 169.80717), (C3, 169.657647), (C3, 169.508124), (C3, 169.358601), (C3, 169.209078), (C3, 169.059555), (C3, 168.910032), (C3, 168.760509), (C3, 168.610986), (C3, C15), (C2, C15)], [(C2, C14), (C2, 173.096674), (C2, 172.947152), (C2, 172.797629), (C2, 172.648106), (C2, 172.498583), (C2, 172.34906), (C2, 172.199537), (C2, 172.050014), (C2, 171.900491), (C2, 171.750968), (C2, 171.601445), (C2, 171.451922), (C2, 171.302399), (C2, 171.152876), (C2, 171.003353), (C2, 170.85383), (C2, 170.704308), (C2, 170.554785), (C2, 170.405262), (C2, 170.255739), (C2, 170.106216), (C2, 169.956693), (C2, 169.80717), (C2, 169.657647), (C2, 169.508124), (C2, 169.358601), (C2, 169.209078), (C2, 169.059555), (C2, 168.910032), (C2, 168.760509), (C2, 168.610986), (C2, C15), (C2, 167.794174), (C2, 167.126884), (C2, 166.459594), (C2, 165.792304), (C2, 165.125014), (C2, 164.457724), (C2, 163.790435), (C2, 163.123145), (C2, 162.455855), (C2, 161.788565), (C2, 161.121275), (C2, 160.453985), (C2, 159.786696), (C2, 159.119406), (C2, 158.452116), (C2, 157.784826), (C2, 157.117536), (C2, 156.450246), (C2, 155.782957), (C2, 155.115667), (C2, 154.448377), (C2, 153.781087), (C2, 153.113797), (C2, 152.446507), (C2, 151.779217), (C2, 151.111928), (C2, 150.444638), (C2, 149.777348), (C2, 149.110058), (C2, 148.442768), (C2, 147.775478), (C2, C4)], [(C3, C4), (C2, C4)], [(C3, C15), (C3, 167.794174), (C3, 167.126884), (C3, 166.459594), (C3, 165.792304), (C3, 165.125014), (C3, 164.457724), (C3, 163.790435), (C3, 163.123145), (C3, 162.455855), (C3, 161.788565), (C3, 161.121275), (C3, 160.453985), (C3, 159.786696), (C3, 159.119406), (C3, 158.452116), (C3, 157.784826), (C3, 157.117536), (C3, 156.450246), (C3, 155.782957), (C3, 155.115667), (C3, 154.448377), (C3, 153.781087), (C3, 153.113797), (C3, 152.446507), (C3, 151.779217), (C3, 151.111928), (C3, 150.444638), (C3, 149.777348), (C3, 149.110058), (C3, 148.442768), (C3, 147.775478), (C3, C4)], [(C2, C4), (C2, C7)], [(C3, C7), (C2, C7)], [(C3, C4), (C3, C7)], [(C2, C7), (C2, 117.686773), (C2, 117.383459), (C2, 117.080146), (C2, 116.776832), (C2, 116.473519), (C2, 116.170205), (C2, 115.866891), (C2, 115.563578), (C2, 115.260264), (C2, 114.956951), (C2, 114.653637), (C2, 114.350324), (C2, 114.04701), (C2, 113.743696), (C2, 113.440383), (C2, 113.137069), (C2, 112.833756), (C2, 112.530442), (C2, 112.227129), (C2, 111.923815), (C2, 111.620502), (C2, 111.317188), (C2, 111.013874), (C2, 110.710561), (C2, 110.407247), (C2, 110.103934), (C2, 109.80062), (C2, 109.497307), (C2, 109.193993), (C2, 108.890679), (C2, 108.587366), (C2, C8)], [(C3, C7), (C3, 117.686773), (C3, 117.383459), (C3, 117.080146), (C3, 116.776832), (C3, 116.473519), (C3, 116.170205), (C3, 115.866891), (C3, 115.563578), (C3, 115.260264), (C3, 114.956951), (C3, 114.653637), (C3, 114.350324), (C3, 114.04701), (C3, 113.743696), (C3, 113.440383), (C3, 113.137069), (C3, 112.833756), (C3, 112.530442), (C3, 112.227129), (C3, 111.923815), (C3, 111.620502), (C3, 111.317188), (C3, 111.013874), (C3, 110.710561), (C3, 110.407247), (C3, 110.103934), (C3, 109.80062), (C3, 109.497307), (C3, 109.193993), (C3, 108.890679), (C3, 108.587366), (C3, C8)], [(C2, C14), (C3, C14)]])\nVISIBLE_CIRCLES = [(130.2793, 121.8725, 19.412068)]\nVISIBLE_ARCS = [(99.240171, 103.66052, 15.294804, 162.404544, -104.782956), (110.165321, 84.525465, 15.451674, 76.474833, 163.662333), (151.790982, 88.030866, 13.456355, 3.583731, 111.864981), (161.318429, 103.66052, 15.294804, -75.217044, 17.595456), (172.769241, 122.797481, 14.846771, -165.023316, -77.835816), (149.158305, 157.43405, 13.1872, 123.256813, -128.461937), (130.764602, 157.834414, 15.411783, 43.59375, 136.40625), (108.38864, 157.784826, 15.483698, -43.59375, 43.59375), (90.373915, 119.801808, 12.856779, -116.382084, -8.100834), (104.410193, -124.5338, 188.75423, 96.007032, 96.223006)]\nHIDDEN_SEGMENTS = [(95.3376, 74.872, 95.3376, 63.1462), (113.7791, 74.872, 113.7791, 63.1462), (146.7796, 74.872, 146.7796, 63.1462), (165.221, 74.872, 165.221, 63.1462), (140.956, 74.872, 140.956, 63.1462), (149.6914, 74.872, 149.6914, 63.1462), (135.9711, 63.1462, 135.9711, 74.872), (123.8724, 63.1462, 123.8724, 74.872), (110.8673, 63.1462, 110.8673, 74.872), (190.6133, 99.5486, 202.339, 99.5486), (190.6133, 100.5192, 202.339, 100.5192), (190.6133, 118.9607, 202.339, 118.9607), (202.339, 99.9771, 190.6133, 99.9771), (202.339, 101.4872, 190.6133, 101.4872), (202.339, 106.945, 190.6133, 106.945), (202.339, 141.2846, 190.6133, 141.2846), (202.339, 102.4604, 190.6133, 102.4604)]\nDIMENSIONS = [('horizontal', '66.7017', (141.9266, 168.4614), (119.6027, 168.4614), (130.7646, 157.4614)), ('vertical', '63.8016', (119.6027, 168.4614), (119.6027, 147.1082), (130.6027, 157.7848)), ('aligned', '98.6452', (113.7791, 99.5486), (146.7796, 100.5192), (129.9559, 111.0292)), ('aligned', '98.9856', (158.4268, 118.9607), (140.9559, 147.1082), (140.3453, 127.2334)), ('aligned', '100', (119.6027, 147.1082), (103.1024, 117.9901), (120.9228, 127.126)), ('diameter', '%%c116.003', (130.2793, 121.8725), 19.4121, 45), ('horizontal', '136.304', (84.661, 121.8725), (130.2793, 121.8725), (107.4701, 132.8725)), ('vertical', '98.6025', (130.2793, 88.872), (130.2793, 121.8725), (119.2793, 105.3722)), ('radius', 'R45.6995', (99.2402, 103.6605), 15.2948, 45), ('radius', 'R46.1682', (110.1653, 84.5254), 15.4517, 45), ('radius', 'R40.2064', (151.791, 88.0309), 13.4564, 45), ('radius', 'R44.3608', (172.7693, 122.7975), 14.8468, 45), ('radius', 'R39.4021', (149.1583, 157.434), 13.1872, 45), ('radius', 'R46.049', (130.7646, 157.8344), 15.4118, 45), ('radius', 'R46.2639', (108.3886, 157.7848), 15.4837, 45), ('radius', 'R38.4149', (90.3739, 119.8018), 12.8568, 45), ('horizontal', '35.0356', (190.6133, 108.284), (202.339, 108.284), (196.4762, 119.284))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00625681_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0062_00627548","images":["images/0062_00627548.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 11 straight edges, featuring 3 circular holes, each of diameter 35.9 mm. It is extruded to a thickness of 11.01 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.865722396159353\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (61.950018, 71.477778, 200.638028, 210.165789, 135.088004, 130.648402, 122.879098, 118.439496, 172.050018, 81.81278, 186.638028, 166.165218, 66.921376, 85.477779, 163.170814, 185.998253)\nVISIBLE_SEGMENTS = _segments([[(C4, C8), (C5, C14), (C6, C14), (C7, C8)], [(C10, C1), (C15, C1), (185.358478, C1), (184.718702, C1), (184.078927, C1), (183.439152, C1), (182.799376, C1), (182.159601, C1), (181.519826, C1), (180.88005, C1), (180.240275, C1), (179.6005, C1), (178.960725, C1), (178.320949, C1), (177.681174, C1), (177.041399, C1), (176.401623, C1), (175.761848, C1), (175.122073, C1), (174.482297, C1), (173.842522, C1), (173.202747, C1), (172.562971, C1), (171.923196, C1), (171.283421, C1), (170.643645, C1), (170.00387, C1), (169.364095, C1), (168.72432, C1), (168.084544, C1), (167.444769, C1), (166.804994, C1), (C11, C1), (C11, C0)], [(C10, C0), (C15, C0), (185.358478, C0), (184.718702, C0), (184.078927, C0), (183.439152, C0), (182.799376, C0), (182.159601, C0), (181.519826, C0), (180.88005, C0), (180.240275, C0), (179.6005, C0), (178.960725, C0), (178.320949, C0), (177.681174, C0), (177.041399, C0), (176.401623, C0), (175.761848, C0), (175.122073, C0), (174.482297, C0), (173.842522, C0), (173.202747, C0), (172.562971, C0), (171.923196, C0), (171.283421, C0), (170.643645, C0), (170.00387, C0), (169.364095, C0), (168.72432, C0), (168.084544, C0), (167.444769, C0), (166.804994, C0), (C11, C0), (165.194055, C0), (164.222892, C0), (163.251729, C0), (162.280567, C0), (161.309404, C0), (160.338241, C0), (159.367078, C0), (158.395915, C0), (157.424752, C0), (156.453589, C0), (155.482426, C0), (154.511263, C0), (153.5401, C0), (152.568937, C0), (151.597774, C0), (150.626611, C0), (149.655448, C0), (148.684285, C0), (147.713122, C0), (146.741959, C0), (145.770796, C0), (144.799634, C0), (143.828471, C0), (142.857308, C0), (141.886145, C0), (140.914982, C0), (139.943819, C0), (138.972656, C0), (138.001493, C0), (137.03033, C0), (136.059167, C0), (C4, C0)], [(C4, C1), (C4, C0)], [(C11, C1), (165.194055, C1), (164.222892, C1), (163.251729, C1), (162.280567, C1), (161.309404, C1), (160.338241, C1), (159.367078, C1), (158.395915, C1), (157.424752, C1), (156.453589, C1), (155.482426, C1), (154.511263, C1), (153.5401, C1), (152.568937, C1), (151.597774, C1), (150.626611, C1), (149.655448, C1), (148.684285, C1), (147.713122, C1), (146.741959, C1), (145.770796, C1), (144.799634, C1), (143.828471, C1), (142.857308, C1), (141.886145, C1), (140.914982, C1), (139.943819, C1), (138.972656, C1), (138.001493, C1), (137.03033, C1), (136.059167, C1), (C4, C1)], [(C4, C0), (C5, C0)], [(C5, C1), (C5, C0)], [(C4, C1), (C5, C1)], [(C5, C0), (C6, C0)], [(C6, C1), (C6, C0)], [(C5, C1), (C6, C1)], [(C6, C0), (C7, C0)], [(C7, C1), (C7, C0)], [(C6, C1), (C7, C1)], [(C7, C0), (117.294912, C0), (116.150327, C0), (115.005742, C0), (113.861157, C0), (112.716572, C0), (111.571987, C0), (110.427402, C0), (109.282817, C0), (108.138232, C0), (106.993647, C0), (105.849063, C0), (104.704478, C0), (103.559893, C0), (102.415308, C0), (101.270723, C0), (100.126138, C0), (98.981553, C0), (97.836968, C0), (96.692383, C0), (95.547798, C0), (94.403214, C0), (93.258629, C0), (92.114044, C0), (90.969459, C0), (89.824874, C0), (88.680289, C0), (87.535704, C0), (86.391119, C0), (85.246534, C0), (84.101949, C0), (82.957365, C0), (C9, C0)], [(C9, C1), (C9, C0)], [(C7, C1), (117.294912, C1), (116.150327, C1), (115.005742, C1), (113.861157, C1), (112.716572, C1), (111.571987, C1), (110.427402, C1), (109.282817, C1), (108.138232, C1), (106.993647, C1), (105.849063, C1), (104.704478, C1), (103.559893, C1), (102.415308, C1), (101.270723, C1), (100.126138, C1), (98.981553, C1), (97.836968, C1), (96.692383, C1), (95.547798, C1), (94.403214, C1), (93.258629, C1), (92.114044, C1), (90.969459, C1), (89.824874, C1), (88.680289, C1), (87.535704, C1), (86.391119, C1), (85.246534, C1), (84.101949, C1), (82.957365, C1), (C9, C1), (81.347423, C1), (80.882067, C1), (80.416711, C1), (79.951354, C1), (79.485998, C1), (79.020642, C1), (78.555285, C1), (78.089929, C1), (77.624572, C1), (77.159216, C1), (76.69386, C1), (76.228503, C1), (75.763147, C1), (75.297791, C1), (74.832434, C1), (74.367078, C1), (73.901722, C1), (73.436365, C1), (72.971009, C1), (72.505652, C1), (72.040296, C1), (71.57494, C1), (71.109583, C1), (70.644227, C1), (70.178871, C1), (69.713514, C1), (69.248158, C1), (68.782802, C1), (68.317445, C1), (67.852089, C1), (67.386732, C1), (C12, C1)], [(C9, C0), (81.347423, C0), (80.882067, C0), (80.416711, C0), (79.951354, C0), (79.485998, C0), (79.020642, C0), (78.555285, C0), (78.089929, C0), (77.624572, C0), (77.159216, C0), (76.69386, C0), (76.228503, C0), (75.763147, C0), (75.297791, C0), (74.832434, C0), (74.367078, C0), (73.901722, C0), (73.436365, C0), (72.971009, C0), (72.505652, C0), (72.040296, C0), (71.57494, C0), (71.109583, C0), (70.644227, C0), (70.178871, C0), (69.713514, C0), (69.248158, C0), (68.782802, C0), (68.317445, C0), (67.852089, C0), (67.386732, C0), (C12, C0)], [(C10, C0), (C10, C1)], [(C12, C0), (C12, C1)], [(C2, C13), (C3, C13)], [(C2, C8), (C3, C8)], [(C2, C8), (C2, 169.344636), (C2, 166.639253), (C2, 163.933871), (C2, 161.228488), (C2, 158.523106), (C2, 155.817723), (C2, 153.112341), (C2, 150.406958), (C2, 147.701576), (C2, 144.996193), (C2, 142.290811), (C2, 139.585428), (C2, 136.880046), (C2, 134.174663), (C2, 131.469281), (C2, 128.763898), (C2, 126.058516), (C2, 123.353134), (C2, 120.647751), (C2, 117.942369), (C2, 115.236986), (C2, 112.531604), (C2, 109.826221), (C2, 107.120839), (C2, 104.415456), (C2, 101.710074), (C2, 99.004691), (C2, 96.299309), (C2, 93.593926), (C2, 90.888544), (C2, 88.183161), (C2, C13)], [(C3, C8), (C3, 169.344636), (C3, 166.639253), (C3, 163.933871), (C3, 161.228488), (C3, 158.523106), (C3, 155.817723), (C3, 153.112341), (C3, 150.406958), (C3, 147.701576), (C3, 144.996193), (C3, 142.290811), (C3, 139.585428), (C3, 136.880046), (C3, 134.174663), (C3, 131.469281), (C3, 128.763898), (C3, 126.058516), (C3, 123.353134), (C3, 120.647751), (C3, 117.942369), (C3, 115.236986), (C3, 112.531604), (C3, 109.826221), (C3, 107.120839), (C3, 104.415456), (C3, 101.710074), (C3, 99.004691), (C3, 96.299309), (C3, 93.593926), (C3, 90.888544), (C3, 88.183161), (C3, C13)]])\nVISIBLE_CIRCLES = [(86.252382, 132.0936, 15.538607), (126.2088, 132.0936, 15.538607), (166.165218, 132.0936, 15.538607)]\nVISIBLE_ARCS = [(99.558874, 90.376008, 18.409685, 89.961677, -164.569573), (112.261243, 100.130778, 15.360501, 24.767608, 145.705108), (140.693439, 100.039756, 15.88695, 33.402046, 155.745796), (151.637295, 92.71944, 16.232751, -26.49465, 81.7866), (130.641218, 128.763898, 55.99681, -50.625, 50.625), (150.626611, 169.745084, 15.708629, 171.5625, 8.4375), (100.126138, 170.472966, 18.381137, 175.078125, 4.921875), (137.278816, 128.763898, 70.35744, 142.03125, -142.03125)]\nHIDDEN_SEGMENTS = [(99.5712, 71.4778, 99.5712, 61.95), (126.2088, 71.4778, 126.2088, 61.95), (153.9563, 71.4778, 153.9563, 61.95), (101.791, 71.4778, 101.791, 61.95), (141.7474, 71.4778, 141.7474, 61.95), (181.7038, 71.4778, 181.7038, 61.95), (81.1492, 61.95, 81.1492, 71.4778), (167.8701, 61.95, 167.8701, 71.4778), (70.7138, 61.95, 70.7138, 71.4778), (110.6702, 61.95, 110.6702, 71.4778), (150.6266, 61.95, 150.6266, 71.4778), (200.638, 108.7857, 210.1658, 108.7857), (200.638, 106.5659, 210.1658, 106.5659), (200.638, 163.1708, 210.1658, 163.1708), (210.1658, 108.7857, 200.638, 108.7857), (210.1658, 115.4913, 200.638, 115.4913), (210.1658, 115.9267, 200.638, 115.9267), (210.1658, 154.0364, 200.638, 154.0364), (210.1658, 152.0918, 200.638, 152.0918), (210.1658, 147.6322, 200.638, 147.6322), (210.1658, 116.555, 200.638, 116.555)]\nDIMENSIONS = [('horizontal', '8.9744', (130.6484, 163.1708), (122.8791, 163.1708), (126.7638, 152.1708)), ('horizontal', '35.8974', (166.1652, 172.05), (135.088, 172.05), (150.6266, 161.05)), ('horizontal', '42.3077', (118.4395, 172.05), (81.8128, 172.05), (100.1261, 161.05)), ('vertical', '100', (166.1652, 85.4778), (166.1652, 172.05), (155.1652, 128.7639)), ('aligned', '11.467', (135.088, 172.05), (130.6484, 163.1708), (142.7069, 162.6911)), ('aligned', '11.467', (122.8791, 163.1708), (118.4395, 172.05), (110.8206, 162.6911)), ('diameter', '%%c35.8974', (86.2524, 132.0936), 15.5386, 45), ('horizontal', '5.1282', (81.8128, 132.0936), (86.2524, 132.0936), (84.0326, 143.0936)), ('vertical', '53.8462', (86.2524, 85.4778), (86.2524, 132.0936), (75.2524, 108.7857)), ('diameter', '%%c35.8974', (126.2088, 132.0936), 15.5386, 45), ('horizontal', '51.2821', (81.8128, 132.0936), (126.2088, 132.0936), (104.0108, 143.0936)), ('vertical', '53.8462', (126.2088, 85.4778), (126.2088, 132.0936), (115.2088, 108.7857)), ('diameter', '%%c35.8974', (166.1652, 132.0936), 15.5386, 45), ('horizontal', '97.4359', (81.8128, 132.0936), (166.1652, 132.0936), (123.989, 143.0936)), ('vertical', '53.8462', (166.1652, 85.4778), (166.1652, 132.0936), (155.1652, 108.7857)), ('radius', 'R21.2651', (99.5589, 90.376), 18.4097, 45), ('radius', 'R17.743', (112.2613, 100.1307), 15.3605, 45), ('radius', 'R18.3511', (140.6934, 100.0397), 15.887, 45), ('radius', 'R18.7505', (151.6373, 92.7194), 16.2327, 45), ('radius', 'R64.6822', (130.6413, 128.7639), 55.9968, 45), ('radius', 'R18.1451', (150.6266, 169.7451), 15.7086, 45), ('radius', 'R21.2321', (100.1262, 170.4729), 18.3811, 45), ('radius', 'R81.2702', (137.2788, 128.7639), 70.3574, 45), ('horizontal', '11.0056', (200.638, 85.4778), (210.1658, 85.4778), (205.4019, 96.4778))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0062_00627548_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0063_00636414","images":["images/0063_00636414.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring 2 circular holes, each of diameter 21.98 mm. It is extruded to a thickness of 1.88 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1041823504194397\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(80.225482, 140.809334), (190.643718, 140.809334)], [(193.070492, 138.382559), (193.070492, 112.901428)], [(190.643718, 109.261266), (80.225482, 109.261266)], [(77.798708, 112.901428), (77.798708, 138.382559)], [(77.798708, 93.190516), (77.874545, 93.190516), (77.950381, 93.190516), (78.026218, 93.190516), (78.102055, 93.190516), (78.177892, 93.190516), (78.253728, 93.190516), (78.329565, 93.190516), (78.405402, 93.190516), (78.481238, 93.190516), (78.557075, 93.190516), (78.632912, 93.190516), (78.708748, 93.190516), (78.784585, 93.190516), (78.860422, 93.190516), (78.936259, 93.190516), (79.012095, 93.190516), (79.087932, 93.190516), (79.163769, 93.190516), (79.239605, 93.190516), (79.315442, 93.190516), (79.391279, 93.190516), (79.467115, 93.190516), (79.542952, 93.190516), (79.618789, 93.190516), (79.694626, 93.190516), (79.770462, 93.190516), (79.846299, 93.190516), (79.922136, 93.190516), (79.997972, 93.190516), (80.073809, 93.190516), (80.149646, 93.190516), (80.225482, 93.190516)], [(77.798708, 93.190516), (77.798708, 95.261266)], [(80.225482, 95.261266), (190.643718, 95.261266)], [(80.225482, 93.190516), (190.643718, 93.190516)], [(193.070492, 93.190516), (193.070492, 95.261266)], [(193.130566, 95.261266), (193.130566, 93.190516)], [(77.738634, 95.261266), (77.738634, 93.190516)], [(80.225482, 93.190516), (80.225482, 95.261266)], [(190.643718, 93.190516), (190.643718, 95.261266)], [(209.201317, 138.382559), (209.201317, 138.458396), (209.201317, 138.534233), (209.201317, 138.610069), (209.201317, 138.685906), (209.201317, 138.761743), (209.201317, 138.837579), (209.201317, 138.913416), (209.201317, 138.989253), (209.201317, 139.065089), (209.201317, 139.140926), (209.201317, 139.216763), (209.201317, 139.2926), (209.201317, 139.368436), (209.201317, 139.444273), (209.201317, 139.52011), (209.201317, 139.595946), (209.201317, 139.671783), (209.201317, 139.74762), (209.201317, 139.823456), (209.201317, 139.899293), (209.201317, 139.97513), (209.201317, 140.050967), (209.201317, 140.126803), (209.201317, 140.20264), (209.201317, 140.278477), (209.201317, 140.354313), (209.201317, 140.43015), (209.201317, 140.505987), (209.201317, 140.581823), (209.201317, 140.65766), (209.201317, 140.733497), (209.201317, 140.809334), (207.130567, 140.809334)], [(207.130567, 138.382559), (207.130567, 138.458396), (207.130567, 138.534233), (207.130567, 138.610069), (207.130567, 138.685906), (207.130567, 138.761743), (207.130567, 138.837579), (207.130567, 138.913416), (207.130567, 138.989253), (207.130567, 139.065089), (207.130567, 139.140926), (207.130567, 139.216763), (207.130567, 139.2926), (207.130567, 139.368436), (207.130567, 139.444273), (207.130567, 139.52011), (207.130567, 139.595946), (207.130567, 139.671783), (207.130567, 139.74762), (207.130567, 139.823456), (207.130567, 139.899293), (207.130567, 139.97513), (207.130567, 140.050967), (207.130567, 140.126803), (207.130567, 140.20264), (207.130567, 140.278477), (207.130567, 140.354313), (207.130567, 140.43015), (207.130567, 140.505987), (207.130567, 140.581823), (207.130567, 140.65766), (207.130567, 140.733497), (207.130567, 140.809334)], [(209.201317, 109.261266), (207.130567, 109.261266)], [(209.201317, 109.261266), (209.201317, 109.375021), (209.201317, 109.488777), (209.201317, 109.602532), (209.201317, 109.716287), (209.201317, 109.830042), (209.201317, 109.943797), (209.201317, 110.057552), (209.201317, 110.171307), (209.201317, 110.285062), (209.201317, 110.398817), (209.201317, 110.512572), (209.201317, 110.626327), (209.201317, 110.740082), (209.201317, 110.853837), (209.201317, 110.967592), (209.201317, 111.081347), (209.201317, 111.195102), (209.201317, 111.308857), (209.201317, 111.422612), (209.201317, 111.536367), (209.201317, 111.650122), (209.201317, 111.763878), (209.201317, 111.877633), (209.201317, 111.991388), (209.201317, 112.105143), (209.201317, 112.218898), (209.201317, 112.332653), (209.201317, 112.446408), (209.201317, 112.560163), (209.201317, 112.673918), (209.201317, 112.787673), (209.201317, 112.901428), (207.130567, 112.901428)], [(207.130567, 109.261266), (207.130567, 109.375021), (207.130567, 109.488777), (207.130567, 109.602532), (207.130567, 109.716287), (207.130567, 109.830042), (207.130567, 109.943797), (207.130567, 110.057552), (207.130567, 110.171307), (207.130567, 110.285062), (207.130567, 110.398817), (207.130567, 110.512572), (207.130567, 110.626327), (207.130567, 110.740082), (207.130567, 110.853837), (207.130567, 110.967592), (207.130567, 111.081347), (207.130567, 111.195102), (207.130567, 111.308857), (207.130567, 111.422612), (207.130567, 111.536367), (207.130567, 111.650122), (207.130567, 111.763878), (207.130567, 111.877633), (207.130567, 111.991388), (207.130567, 112.105143), (207.130567, 112.218898), (207.130567, 112.332653), (207.130567, 112.446408), (207.130567, 112.560163), (207.130567, 112.673918), (207.130567, 112.787673), (207.130567, 112.901428), (207.130567, 138.382559)], [(209.201317, 112.901428), (209.201317, 138.382559), (207.130567, 138.382559)]])\nVISIBLE_CIRCLES = [(94.786129, 125.0353, 12.133872), (176.083071, 125.0353, 12.133872)]\nVISIBLE_ARCS = [(80.225482, 138.382559, 2.426774, 90.0, -180.0), (190.643718, 138.382559, 2.426774, -0.0, 90.0), (190.037024, 112.294734, 3.093543, -78.690068, 11.309932), (80.832176, 112.294734, 3.093543, 168.690068, -101.309932), (181.619906, 8956.397524, 8861.73045, -90.671273, -90.655584), (201.377349, 2108.346896, 2015.178955, -90.30518, -90.236183), (153.73336, -1117.444449, 1213.305319, 88.14212, 88.256663), (139.013705, -204.787212, 302.84668, 79.70649, 79.717673), (606.33725, -10323.999236, 10427.451942, 92.271044, 92.271374), (107.10456, 941.114324, 848.431129, -91.983517, -91.979463), (79.450224, -758.774126, 854.037048, 90.110797, 90.114828)]\nHIDDEN_SEGMENTS = [(106.92, 93.1906, 106.92, 95.2613), (188.2169, 93.1906, 188.2169, 95.2613), (82.6522, 95.2613, 82.6522, 93.1906), (163.9492, 95.2613, 163.9492, 93.1906), (207.1306, 137.1692, 209.2013, 137.1692)]\nDIMENSIONS = [('horizontal', '100', (80.2254, 140.8094), (190.6437, 140.8094), (135.4345, 151.8094)), ('vertical', '23.0769', (193.0704, 138.3826), (193.0704, 112.9015), (204.0704, 125.642)), ('diameter', '%%c21.978', (94.7862, 125.0353), 12.1339, 45), ('horizontal', '15.3846', (77.7987, 125.0353), (94.7862, 125.0353), (86.2924, 136.0353)), ('vertical', '14.2857', (94.7862, 140.8094), (94.7862, 125.0353), (105.7862, 132.9223)), ('diameter', '%%c21.978', (176.083, 125.0353), 12.1339, 45), ('horizontal', '89.011', (77.7987, 125.0353), (176.083, 125.0353), (126.9408, 136.0353)), ('vertical', '14.2857', (176.083, 140.8094), (176.083, 125.0353), (187.083, 132.9223)), ('radius', 'R2.1978', (80.2254, 138.3826), 2.4268, 45), ('radius', 'R2.8017', (190.037, 112.2948), 3.0936, 45), ('horizontal', '1.8754', (209.2013, 138.3826), (207.1305, 138.3826), (208.1659, 127.3826))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0063_00636414_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00663080","images":["images/0066_00663080.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 13 straight edges. It is extruded to a thickness of 60.27 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3044876890132206\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(95.385311, 108.972458), (106.64527, 101.934984), (111.571501, 98.416247)], [(160.833821, 146.271071), (160.833821, 146.974819)], [(160.833821, 80.562354), (160.833821, 62.209725)], [(160.833821, 80.562354), (153.796347, 80.562354), (153.796347, 62.209725)], [(160.833821, 62.209725), (153.796347, 62.209725)], [(153.796347, 80.562354), (144.64763, 80.562354), (144.64763, 62.209725)], [(153.796347, 62.209725), (144.64763, 62.209725)], [(144.64763, 80.562354), (131.276429, 80.562354), (131.276429, 62.209725)], [(144.64763, 62.209725), (131.276429, 62.209725)], [(131.276429, 80.562354), (105.941522, 80.562354), (105.941522, 62.209725)], [(131.276429, 62.209725), (105.941522, 62.209725)], [(105.941522, 80.562354), (101.719038, 80.562354), (101.719038, 62.209725)], [(105.941522, 62.209725), (101.719038, 62.209725)], [(101.719038, 80.562354), (93.649284, 80.562354)], [(101.719038, 62.209725), (93.649284, 62.209725), (93.649284, 80.562354)], [(174.833821, 123.047406), (174.833821, 108.972458), (193.18645, 108.972458)], [(193.18645, 123.047406), (193.18645, 108.972458)], [(174.833821, 123.047406), (193.18645, 123.047406)], [(193.18645, 108.972458), (193.18645, 101.934984)], [(174.833821, 101.934984), (193.18645, 101.934984)], [(174.833821, 108.972458), (174.833821, 101.934984)], [(193.18645, 101.934984), (193.18645, 98.416247)], [(174.833821, 98.416247), (193.18645, 98.416247)], [(174.833821, 101.934984), (174.833821, 98.416247), (174.833821, 94.562355)], [(193.18645, 98.416247), (193.18645, 94.562355)], [(174.833821, 172.309726), (193.18645, 172.309726)], [(174.833821, 172.309726), (174.833821, 155.419788), (193.18645, 155.419788)], [(193.18645, 172.309726), (193.18645, 155.419788)], [(174.833821, 155.419788), (174.833821, 146.974819), (193.18645, 146.974819)], [(193.18645, 155.419788), (193.18645, 146.974819)], [(174.833821, 146.974819), (174.833821, 123.047406)], [(193.18645, 146.974819), (193.18645, 123.047406)], [(193.18645, 94.562355), (174.833821, 94.562355)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(142.124361, 120.754212, 48.201126, 177.273093, -165.851907), (124.399863, 117.840036, 23.277682, -123.442602, -72.817602), (117.356397, 125.388467, 32.879252, -64.952575, -11.515075), (118.285117, 147.69414, 42.572495, -42.69683, -1.91558), (142.719911, 143.482815, 18.447434, 10.911633, 53.099133), (130.322885, 137.18468, 31.52951, 41.884533, 62.978283), (102.235692, 100.910948, 77.078855, 56.616459, 67.866459), (154.169069, 110.524617, 65.889852, 110.330693, 137.049443), (115.189887, 145.517499, 13.549449, 133.044324, 173.825574), (121.616229, 127.321529, 27.966945, 135.35333, -171.20917)]\nHIDDEN_SEGMENTS = [(95.3853, 80.5624, 95.3853, 62.2097), (106.6453, 80.5624, 106.6453, 62.2097), (111.5715, 80.5624, 111.5715, 62.2097), (149.5739, 80.5624, 149.5739, 62.2097), (174.8338, 95.6013, 193.1864, 95.6013), (174.8338, 118.8249, 193.1864, 118.8249), (174.8338, 146.2711, 193.1864, 146.2711), (174.8338, 158.2348, 193.1864, 158.2348), (174.8338, 165.2723, 193.1864, 165.2723)]\nDIMENSIONS = [('vertical', '2.3113', (160.8338, 146.2711), (160.8338, 146.9748), (149.8338, 146.6229)), ('aligned', '43.6086', (95.3853, 108.9724), (106.6453, 101.935), (106.8453, 114.7817)), ('aligned', '19.8821', (106.6453, 101.935), (111.5715, 98.4163), (115.502, 109.1267)), ('radius', 'R158.302', (142.1244, 120.7542), 48.2011, 45), ('radius', 'R76.4487', (124.3999, 117.84), 23.2777, 45), ('radius', 'R107.982', (117.3564, 125.3885), 32.8793, 45), ('radius', 'R139.817', (118.2851, 147.6941), 42.5725, 45), ('radius', 'R60.5852', (142.7199, 143.4828), 18.4474, 45), ('radius', 'R103.549', (130.3229, 137.1847), 31.5295, 45), ('radius', 'R253.143', (102.2357, 100.911), 77.0789, 45), ('radius', 'R216.396', (154.1691, 110.5246), 65.8899, 45), ('radius', 'R44.4992', (115.1899, 145.5175), 13.5495, 45), ('radius', 'R91.8492', (121.6162, 127.3215), 27.967, 45), ('horizontal', '60.2738', (174.8338, 123.0474), (193.1865, 123.0474), (184.0101, 134.0474))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00663080_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0071_00717253","images":["images/0071_00717253.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 65.15 mm tall, featuring 2 circular holes, each of diameter 30.3 mm. It is extruded to a thickness of 8.81 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7428895147365849\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(191.680896, 88.480535), (158.628772, 88.480535)], [(191.680896, 81.933735), (158.628772, 81.933735), (84.33982, 81.933735)], [(158.628772, 88.480535), (84.33982, 88.480535), (51.287696, 88.480535)], [(84.33982, 81.933735), (51.287696, 81.933735)], [(191.680896, 81.933735), (191.680896, 88.480535)], [(51.287696, 81.933735), (51.287696, 88.480535)], [(158.628772, 88.480535), (158.628772, 81.933735)], [(84.33982, 88.480535), (84.33982, 81.933735)], [(205.680896, 153.251616), (205.680896, 102.480536)], [(212.227696, 153.251616), (212.227696, 102.480536)], [(212.227696, 153.251616), (205.680896, 153.251616)], [(212.227696, 102.480536), (205.680896, 102.480536)]])\nVISIBLE_CIRCLES = [(76.460689, 127.303281, 11.255902), (166.507903, 127.303281, 11.255902)]\nVISIBLE_ARCS = [(121.484296, -13.583635, 122.99253, 72.421875, 107.578125), (166.295356, 127.866076, 25.38554, -107.578125, 107.578125), (121.484296, 269.315786, 122.99253, -107.578125, -72.421875), (76.673236, 127.866076, 25.38554, 72.421875, -72.421875)]\nHIDDEN_SEGMENTS = [(87.7166, 88.4805, 87.7166, 81.9337), (177.7638, 88.4805, 177.7638, 81.9337), (65.2048, 81.9337, 65.2048, 88.4805), (155.252, 81.9337, 155.252, 88.4805), (212.2277, 109.4089, 205.6809, 109.4089), (212.2277, 146.3233, 205.6809, 146.3233), (212.2277, 138.5592, 205.6809, 138.5592), (212.2277, 116.0474, 205.6809, 116.0474)]\nDIMENSIONS = [('horizontal', '100', (84.3398, 103.6659), (158.6287, 103.6659), (121.4843, 114.6659)), ('vertical', '65.1515', (158.6287, 103.6659), (158.6287, 152.0663), (147.6287, 127.8661)), ('diameter', '%%c30.303', (76.4607, 127.3033), 11.2559, 45), ('horizontal', '10.6061', (84.3398, 127.3033), (76.4607, 127.3033), (80.4002, 116.3033)), ('vertical', '31.8182', (76.4607, 103.6659), (76.4607, 127.3033), (65.4607, 115.4846)), ('diameter', '%%c30.303', (166.5079, 127.3033), 11.2559, 45), ('horizontal', '110.606', (84.3398, 127.3033), (166.5079, 127.3033), (125.4238, 138.3033)), ('vertical', '31.8182', (166.5079, 103.6659), (166.5079, 127.3033), (155.5079, 115.4846)), ('radius', 'R165.56', (121.4843, -13.5836), 122.9926, 45), ('radius', 'R34.1714', (166.2954, 127.8661), 25.3856, 135), ('horizontal', '8.8126', (205.6809, 103.6659), (212.2277, 103.6659), (208.9543, 114.6659))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0071_00717253_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0071_00718502","images":["images/0071_00718502.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 5 straight edges. It is extruded to a thickness of 79.17 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5363720930232598\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(142.087203, 172.050004), (142.087203, 118.412794), (115.5509, 118.412794), (115.5509, 144.949098)], [(88.449994, 172.050004), (142.087203, 172.050004)], [(142.087203, 61.950003), (142.087203, 104.412794)], [(88.449994, 61.950003), (88.449994, 104.412794), (142.087203, 104.412794)], [(88.449994, 61.950003), (142.087203, 61.950003)], [(198.549994, 118.412794), (156.087203, 118.412794), (156.087203, 144.949098)], [(198.549994, 144.949098), (156.087203, 144.949098)], [(198.549994, 118.412794), (198.549994, 144.949098), (198.549994, 145.796001), (198.549994, 146.642904), (198.549994, 147.489808), (198.549994, 148.336711), (198.549994, 149.183614), (198.549994, 150.030518), (198.549994, 150.877421), (198.549994, 151.724324), (198.549994, 152.571228), (198.549994, 153.418131), (198.549994, 154.265034), (198.549994, 155.111937), (198.549994, 155.958841), (198.549994, 156.805744), (198.549994, 157.652647), (198.549994, 158.499551), (198.549994, 159.346454), (198.549994, 160.193357), (198.549994, 161.040261), (198.549994, 161.887164), (198.549994, 162.734067), (198.549994, 163.580971), (198.549994, 164.427874), (198.549994, 165.274777), (198.549994, 166.12168), (198.549994, 166.968584), (198.549994, 167.815487), (198.549994, 168.66239), (198.549994, 169.509294), (198.549994, 170.356197), (198.549994, 171.2031), (198.549994, 172.050004), (156.087203, 172.050004)], [(156.087203, 144.949098), (156.087203, 145.796001), (156.087203, 146.642904), (156.087203, 147.489808), (156.087203, 148.336711), (156.087203, 149.183614), (156.087203, 150.030518), (156.087203, 150.877421), (156.087203, 151.724324), (156.087203, 152.571228), (156.087203, 153.418131), (156.087203, 154.265034), (156.087203, 155.111937), (156.087203, 155.958841), (156.087203, 156.805744), (156.087203, 157.652647), (156.087203, 158.499551), (156.087203, 159.346454), (156.087203, 160.193357), (156.087203, 161.040261), (156.087203, 161.887164), (156.087203, 162.734067), (156.087203, 163.580971), (156.087203, 164.427874), (156.087203, 165.274777), (156.087203, 166.12168), (156.087203, 166.968584), (156.087203, 167.815487), (156.087203, 168.66239), (156.087203, 169.509294), (156.087203, 170.356197), (156.087203, 171.2031), (156.087203, 172.050004)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(115.5509, 172.050004, 27.100906, -180.0, -90.0)]\nHIDDEN_SEGMENTS = [(115.5509, 61.95, 115.5509, 104.4128)]\nDIMENSIONS = [('horizontal', '49.4737', (142.0872, 118.4128), (115.5509, 118.4128), (128.819, 107.4128)), ('horizontal', '100', (88.45, 172.05), (142.0872, 172.05), (115.2686, 183.05)), ('vertical', '49.4737', (115.5509, 118.4128), (115.5509, 144.9491), (104.5509, 131.6809)), ('vertical', '100', (142.0872, 172.05), (142.0872, 118.4128), (153.0872, 145.2314)), ('radius', 'R50.5263', (115.5509, 172.05), 27.1009, 45), ('horizontal', '79.1667', (198.55, 172.05), (156.0872, 172.05), (177.3186, 161.05))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0071_00718502_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0072_00729366","images":["images/0072_00729366.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 71.58 mm wide and 100 mm tall. It is extruded to a thickness of -47.71 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6505884955751979\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(135.441242, 106.991186), (88.872802, 106.991186)], [(88.872802, 172.050035), (135.441242, 172.050035)], [(153.086053, 61.950035), (152.534653, 61.950035), (151.983252, 61.950035), (151.431852, 61.950035), (150.880452, 61.950035), (150.329051, 61.950035), (149.777651, 61.950035), (149.226251, 61.950035), (148.67485, 61.950035), (148.12345, 61.950035), (147.57205, 61.950035), (147.020649, 61.950035), (146.469249, 61.950035), (145.917849, 61.950035), (145.366448, 61.950035), (144.815048, 61.950035), (144.263647, 61.950035), (143.712247, 61.950035), (143.160847, 61.950035), (142.609446, 61.950035), (142.058046, 61.950035), (141.506646, 61.950035), (140.955245, 61.950035), (140.403845, 61.950035), (139.852445, 61.950035), (139.301044, 61.950035), (138.749644, 61.950035), (138.198244, 61.950035), (137.646843, 61.950035), (137.095443, 61.950035), (136.544043, 61.950035), (135.992642, 61.950035), (135.441242, 61.950035)], [(135.441242, 92.991186), (135.441242, 61.950035)], [(153.086053, 92.991186), (152.534653, 92.991186), (151.983252, 92.991186), (151.431852, 92.991186), (150.880452, 92.991186), (150.329051, 92.991186), (149.777651, 92.991186), (149.226251, 92.991186), (148.67485, 92.991186), (148.12345, 92.991186), (147.57205, 92.991186), (147.020649, 92.991186), (146.469249, 92.991186), (145.917849, 92.991186), (145.366448, 92.991186), (144.815048, 92.991186), (144.263647, 92.991186), (143.712247, 92.991186), (143.160847, 92.991186), (142.609446, 92.991186), (142.058046, 92.991186), (141.506646, 92.991186), (140.955245, 92.991186), (140.403845, 92.991186), (139.852445, 92.991186), (139.301044, 92.991186), (138.749644, 92.991186), (138.198244, 92.991186), (137.646843, 92.991186), (137.095443, 92.991186), (136.544043, 92.991186), (135.992642, 92.991186), (135.441242, 92.991186)], [(135.441242, 61.950035), (88.872802, 61.950035)], [(88.872802, 92.991186), (88.872802, 61.950035)], [(135.441242, 92.991186), (88.872802, 92.991186)], [(88.872802, 61.950035), (88.321402, 61.950035), (87.770002, 61.950035), (87.218601, 61.950035), (86.667201, 61.950035), (86.115801, 61.950035), (85.5644, 61.950035), (85.013, 61.950035), (84.461599, 61.950035), (83.910199, 61.950035), (83.358799, 61.950035), (82.807398, 61.950035), (82.255998, 61.950035), (81.704598, 61.950035), (81.153197, 61.950035), (80.601797, 61.950035), (80.050397, 61.950035), (79.498996, 61.950035), (78.947596, 61.950035), (78.396196, 61.950035), (77.844795, 61.950035), (77.293395, 61.950035), (76.741995, 61.950035), (76.190594, 61.950035), (75.639194, 61.950035), (75.087794, 61.950035), (74.536393, 61.950035), (73.984993, 61.950035), (73.433593, 61.950035), (72.882192, 61.950035), (72.330792, 61.950035), (71.779392, 61.950035), (71.227991, 61.950035)], [(88.872802, 92.991186), (88.321402, 92.991186), (87.770002, 92.991186), (87.218601, 92.991186), (86.667201, 92.991186), (86.115801, 92.991186), (85.5644, 92.991186), (85.013, 92.991186), (84.461599, 92.991186), (83.910199, 92.991186), (83.358799, 92.991186), (82.807398, 92.991186), (82.255998, 92.991186), (81.704598, 92.991186), (81.153197, 92.991186), (80.601797, 92.991186), (80.050397, 92.991186), (79.498996, 92.991186), (78.947596, 92.991186), (78.396196, 92.991186), (77.844795, 92.991186), (77.293395, 92.991186), (76.741995, 92.991186), (76.190594, 92.991186), (75.639194, 92.991186), (75.087794, 92.991186), (74.536393, 92.991186), (73.984993, 92.991186), (73.433593, 92.991186), (72.882192, 92.991186), (72.330792, 92.991186), (71.779392, 92.991186), (71.227991, 92.991186)], [(153.086053, 61.950035), (153.086053, 92.991186)], [(71.227991, 61.950035), (71.227991, 92.991186)], [(198.127204, 106.991186), (167.086053, 106.991186), (167.086053, 109.024275), (167.086053, 111.057364), (167.086053, 113.090453), (167.086053, 115.123542), (167.086053, 117.156631), (167.086053, 119.18972), (167.086053, 121.222809), (167.086053, 123.255898), (167.086053, 125.288987), (167.086053, 127.322076), (167.086053, 129.355165), (167.086053, 131.388254), (167.086053, 133.421343), (167.086053, 135.454433), (167.086053, 137.487522), (167.086053, 139.520611), (167.086053, 141.5537), (167.086053, 143.586789), (167.086053, 145.619878), (167.086053, 147.652967), (167.086053, 149.686056), (167.086053, 151.719145), (167.086053, 153.752234), (167.086053, 155.785323), (167.086053, 157.818412), (167.086053, 159.851501), (167.086053, 161.88459), (167.086053, 163.917679), (167.086053, 165.950768), (167.086053, 167.983857), (167.086053, 170.016946), (167.086053, 172.050035)], [(198.127204, 172.050035), (167.086053, 172.050035)], [(198.127204, 106.991186), (198.127204, 109.024275), (198.127204, 111.057364), (198.127204, 113.090453), (198.127204, 115.123542), (198.127204, 117.156631), (198.127204, 119.18972), (198.127204, 121.222809), (198.127204, 123.255898), (198.127204, 125.288987), (198.127204, 127.322076), (198.127204, 129.355165), (198.127204, 131.388254), (198.127204, 133.421343), (198.127204, 135.454433), (198.127204, 137.487522), (198.127204, 139.520611), (198.127204, 141.5537), (198.127204, 143.586789), (198.127204, 145.619878), (198.127204, 147.652967), (198.127204, 149.686056), (198.127204, 151.719145), (198.127204, 153.752234), (198.127204, 155.785323), (198.127204, 157.818412), (198.127204, 159.851501), (198.127204, 161.88459), (198.127204, 163.917679), (198.127204, 165.950768), (198.127204, 167.983857), (198.127204, 170.016946), (198.127204, 172.050035)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(114.27853, 139.520611, 38.807523, -56.953125, 56.953125), (110.035514, 139.520611, 38.807523, 123.046875, -123.046875)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '71.5789', (135.4412, 172.05), (88.8728, 172.05), (112.157, 161.05)), ('vertical', '100', (135.4412, 106.9912), (135.4412, 172.05), (124.4412, 139.5206)), ('radius', 'R59.6499', (114.2786, 139.5206), 38.8075, 45), ('horizontal', '47.7124', (198.1272, 106.9912), (167.0861, 106.9912), (182.6066, 95.9912))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0072_00729366_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0074_00741356","images":["images/0074_00741356.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 13.48 mm tall, featuring 2 circular holes, each of diameter 8.99 mm. It is extruded to a thickness of 4.45 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.1573150442477815\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(189.191402, 134.375724), (73.459898, 134.375724)], [(73.459898, 118.771476), (189.191402, 118.771476)], [(189.191402, 104.771476), (189.435219, 104.771476), (189.679035, 104.771476), (189.922851, 104.771476), (190.166668, 104.771476), (190.410484, 104.771476), (190.6543, 104.771476), (190.898117, 104.771476), (191.141933, 104.771476), (191.38575, 104.771476), (191.629566, 104.771476), (191.873382, 104.771476), (192.117199, 104.771476), (192.361015, 104.771476), (192.604831, 104.771476), (192.848648, 104.771476), (193.092464, 104.771476), (193.336281, 104.771476), (193.580097, 104.771476), (193.823913, 104.771476), (194.06773, 104.771476), (194.311546, 104.771476), (194.555362, 104.771476), (194.799179, 104.771476), (195.042995, 104.771476), (195.286812, 104.771476), (195.530628, 104.771476), (195.774444, 104.771476), (196.018261, 104.771476), (196.262077, 104.771476), (196.505893, 104.771476), (196.74971, 104.771476), (196.993526, 104.771476)], [(189.191402, 99.624241), (189.435219, 99.624241), (189.679035, 99.624241), (189.922851, 99.624241), (190.166668, 99.624241), (190.410484, 99.624241), (190.6543, 99.624241), (190.898117, 99.624241), (191.141933, 99.624241), (191.38575, 99.624241), (191.629566, 99.624241), (191.873382, 99.624241), (192.117199, 99.624241), (192.361015, 99.624241), (192.604831, 99.624241), (192.848648, 99.624241), (193.092464, 99.624241), (193.336281, 99.624241), (193.580097, 99.624241), (193.823913, 99.624241), (194.06773, 99.624241), (194.311546, 99.624241), (194.555362, 99.624241), (194.799179, 99.624241), (195.042995, 99.624241), (195.286812, 99.624241), (195.530628, 99.624241), (195.774444, 99.624241), (196.018261, 99.624241), (196.262077, 99.624241), (196.505893, 99.624241), (196.74971, 99.624241), (196.993526, 99.624241)], [(65.657774, 104.771476), (65.90159, 104.771476), (66.145407, 104.771476), (66.389223, 104.771476), (66.633039, 104.771476), (66.876856, 104.771476), (67.120672, 104.771476), (67.364488, 104.771476), (67.608305, 104.771476), (67.852121, 104.771476), (68.095938, 104.771476), (68.339754, 104.771476), (68.58357, 104.771476), (68.827387, 104.771476), (69.071203, 104.771476), (69.315019, 104.771476), (69.558836, 104.771476), (69.802652, 104.771476), (70.046469, 104.771476), (70.290285, 104.771476), (70.534101, 104.771476), (70.777918, 104.771476), (71.021734, 104.771476), (71.26555, 104.771476), (71.509367, 104.771476), (71.753183, 104.771476), (71.997, 104.771476), (72.240816, 104.771476), (72.484632, 104.771476), (72.728449, 104.771476), (72.972265, 104.771476), (73.216081, 104.771476), (73.459898, 104.771476)], [(65.657774, 99.624241), (65.90159, 99.624241), (66.145407, 99.624241), (66.389223, 99.624241), (66.633039, 99.624241), (66.876856, 99.624241), (67.120672, 99.624241), (67.364488, 99.624241), (67.608305, 99.624241), (67.852121, 99.624241), (68.095938, 99.624241), (68.339754, 99.624241), (68.58357, 99.624241), (68.827387, 99.624241), (69.071203, 99.624241), (69.315019, 99.624241), (69.558836, 99.624241), (69.802652, 99.624241), (70.046469, 99.624241), (70.290285, 99.624241), (70.534101, 99.624241), (70.777918, 99.624241), (71.021734, 99.624241), (71.26555, 99.624241), (71.509367, 99.624241), (71.753183, 99.624241), (71.997, 99.624241), (72.240816, 99.624241), (72.484632, 99.624241), (72.728449, 99.624241), (72.972265, 99.624241), (73.216081, 99.624241), (73.459898, 99.624241), (189.191402, 99.624241)], [(73.459898, 104.771476), (189.191402, 104.771476)], [(196.993526, 99.624241), (196.993526, 104.771476)], [(65.657774, 99.624241), (65.657774, 104.771476)], [(189.191402, 104.771476), (189.191402, 99.624241)], [(73.459898, 104.771476), (73.459898, 99.624241)], [(216.140761, 134.375724), (210.993526, 134.375724)], [(216.140761, 134.375724), (216.140761, 133.888091), (216.140761, 133.400458), (216.140761, 132.912826), (216.140761, 132.425193), (216.140761, 131.93756), (216.140761, 131.449927), (216.140761, 130.962295), (216.140761, 130.474662), (216.140761, 129.987029), (216.140761, 129.499396), (216.140761, 129.011764), (216.140761, 128.524131), (216.140761, 128.036498), (216.140761, 127.548865), (216.140761, 127.061233), (216.140761, 126.5736), (216.140761, 126.085967), (216.140761, 125.598335), (216.140761, 125.110702), (216.140761, 124.623069), (216.140761, 124.135436), (216.140761, 123.647804), (216.140761, 123.160171), (216.140761, 122.672538), (216.140761, 122.184905), (216.140761, 121.697273), (216.140761, 121.20964), (216.140761, 120.722007), (216.140761, 120.234374), (216.140761, 119.746742), (216.140761, 119.259109), (216.140761, 118.771476), (210.993526, 118.771476)], [(210.993526, 134.375724), (210.993526, 133.888091), (210.993526, 133.400458), (210.993526, 132.912826), (210.993526, 132.425193), (210.993526, 131.93756), (210.993526, 131.449927), (210.993526, 130.962295), (210.993526, 130.474662), (210.993526, 129.987029), (210.993526, 129.499396), (210.993526, 129.011764), (210.993526, 128.524131), (210.993526, 128.036498), (210.993526, 127.548865), (210.993526, 127.061233), (210.993526, 126.5736), (210.993526, 126.085967), (210.993526, 125.598335), (210.993526, 125.110702), (210.993526, 124.623069), (210.993526, 124.135436), (210.993526, 123.647804), (210.993526, 123.160171), (210.993526, 122.672538), (210.993526, 122.184905), (210.993526, 121.697273), (210.993526, 121.20964), (210.993526, 120.722007), (210.993526, 120.234374), (210.993526, 119.746742), (210.993526, 119.259109), (210.993526, 118.771476)]])\nVISIBLE_CIRCLES = [(73.459898, 126.5736, 5.201416), (189.191402, 126.5736, 5.201416)]\nVISIBLE_ARCS = [(189.191402, 126.5736, 7.802124, -90.0, 90.0), (73.459898, 126.5736, 7.802124, 90.0, -90.0)]\nHIDDEN_SEGMENTS = [(78.6613, 99.6243, 78.6613, 104.7715), (194.3928, 99.6243, 194.3928, 104.7715), (68.2585, 104.7715, 68.2585, 99.6243), (183.99, 104.7715, 183.99, 99.6243), (210.9936, 121.3722, 216.1408, 121.3722), (210.9936, 131.775, 216.1408, 131.775)]\nDIMENSIONS = [('horizontal', '100', (189.1914, 118.7715), (73.4599, 118.7715), (131.3257, 107.7715)), ('vertical', '13.4831', (189.1914, 134.3757), (189.1914, 118.7715), (200.1914, 126.5736)), ('diameter', '%%c8.9888', (73.4599, 126.5736), 5.2014, 45), ('vertical', '6.7416', (73.4599, 134.3757), (73.4599, 126.5736), (84.4599, 130.4747)), ('diameter', '%%c8.9888', (189.1914, 126.5736), 5.2014, 45), ('horizontal', '100', (73.4599, 126.5736), (189.1914, 126.5736), (131.3257, 137.5736)), ('vertical', '6.7416', (189.1914, 134.3757), (189.1914, 126.5736), (200.1914, 130.4747)), ('radius', 'R6.7416', (189.1914, 126.5736), 7.8022, 135), ('horizontal', '4.4476', (216.1408, 134.3757), (210.9935, 134.3757), (213.5671, 123.3757))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0074_00741356_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0076_00760194","images":["images/0076_00760194.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a rectangular plate 100 mm wide and 65.15 mm tall, featuring 2 circular holes, each of diameter 30.3 mm. It is extruded to a thickness of 8.81 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7428895147365849\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(191.680896, 88.480535), (158.628772, 88.480535)], [(191.680896, 81.933735), (158.628772, 81.933735), (84.33982, 81.933735)], [(158.628772, 88.480535), (84.33982, 88.480535), (51.287696, 88.480535)], [(84.33982, 81.933735), (51.287696, 81.933735)], [(191.680896, 81.933735), (191.680896, 88.480535)], [(51.287696, 81.933735), (51.287696, 88.480535)], [(158.628772, 88.480535), (158.628772, 81.933735)], [(84.33982, 88.480535), (84.33982, 81.933735)], [(205.680896, 153.251616), (205.680896, 102.480536)], [(212.227696, 153.251616), (212.227696, 102.480536)], [(212.227696, 153.251616), (205.680896, 153.251616)], [(212.227696, 102.480536), (205.680896, 102.480536)]])\nVISIBLE_CIRCLES = [(76.460689, 127.303281, 11.255902), (166.507903, 127.303281, 11.255902)]\nVISIBLE_ARCS = [(121.484296, -13.583635, 122.99253, 72.421875, 107.578125), (166.295356, 127.866076, 25.38554, -107.578125, 107.578125), (121.484296, 269.315786, 122.99253, -107.578125, -72.421875), (76.673236, 127.866076, 25.38554, 72.421875, -72.421875)]\nHIDDEN_SEGMENTS = [(87.7166, 88.4805, 87.7166, 81.9337), (177.7638, 88.4805, 177.7638, 81.9337), (65.2048, 81.9337, 65.2048, 88.4805), (155.252, 81.9337, 155.252, 88.4805), (212.2277, 109.4089, 205.6809, 109.4089), (212.2277, 146.3233, 205.6809, 146.3233), (212.2277, 138.5592, 205.6809, 138.5592), (212.2277, 116.0474, 205.6809, 116.0474)]\nDIMENSIONS = [('horizontal', '100', (84.3398, 103.6659), (158.6287, 103.6659), (121.4843, 114.6659)), ('vertical', '65.1515', (158.6287, 103.6659), (158.6287, 152.0663), (147.6287, 127.8661)), ('diameter', '%%c30.303', (76.4607, 127.3033), 11.2559, 45), ('horizontal', '10.6061', (84.3398, 127.3033), (76.4607, 127.3033), (80.4002, 116.3033)), ('vertical', '31.8182', (76.4607, 103.6659), (76.4607, 127.3033), (65.4607, 115.4846)), ('diameter', '%%c30.303', (166.5079, 127.3033), 11.2559, 45), ('horizontal', '110.606', (84.3398, 127.3033), (166.5079, 127.3033), (125.4238, 138.3033)), ('vertical', '31.8182', (166.5079, 103.6659), (166.5079, 127.3033), (155.5079, 115.4846)), ('radius', 'R165.56', (121.4843, -13.5836), 122.9926, 45), ('radius', 'R34.1714', (166.2954, 127.8661), 25.3856, 135), ('horizontal', '8.8126', (205.6809, 103.6659), (212.2277, 103.6659), (208.9543, 114.6659))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0076_00760194_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0078_00784614","images":["images/0078_00784614.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 100 x 100 mm. It is extruded to a thickness of 1192.16 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.07370075187970512\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(88.883534, 172.05), (96.253609, 172.05)], [(96.687143, 171.616466), (96.687143, 164.246391)], [(96.253609, 163.812857), (88.883534, 163.812857)], [(88.45, 164.246391), (88.45, 171.616466)], [(88.883534, 164.246391), (88.883534, 171.616466)], [(96.253609, 164.246391), (88.883534, 164.246391)], [(96.253609, 171.616466), (96.253609, 164.246391)], [(88.883534, 171.616466), (96.253609, 171.616466)], [(88.45, 61.95), (88.883534, 61.95)], [(88.45, 149.812857), (88.883534, 149.812857)], [(88.45, 61.95), (88.45, 149.812857)], [(88.883534, 149.812857), (96.253609, 149.812857)], [(88.883534, 61.95), (96.253609, 61.95), (96.687143, 61.95), (96.687143, 149.812857)], [(96.253609, 149.812857), (96.687143, 149.812857)], [(88.883534, 61.95), (88.883534, 149.812857)], [(96.253609, 61.95), (96.253609, 149.812857)], [(198.55, 171.616466), (198.55, 172.05), (110.687143, 172.05)], [(110.687143, 171.616466), (110.687143, 172.05)], [(198.55, 163.812857), (110.687143, 163.812857)], [(198.55, 163.812857), (198.55, 164.246391)], [(110.687143, 163.812857), (110.687143, 164.246391), (110.687143, 171.616466)], [(198.55, 164.246391), (198.55, 171.616466), (110.687143, 171.616466)], [(198.55, 164.246391), (110.687143, 164.246391)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(88.883534, 171.616466, 0.433534, 90.0, 180.0), (96.253609, 171.616466, 0.433534, -0.0, 90.0), (96.253609, 164.246391, 0.433534, -90.0, -0.0), (88.883534, 164.246391, 0.433534, -180.0, -90.0)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (88.8835, 172.05), (96.2536, 172.05), (92.5686, 183.05)), ('vertical', '100', (96.6871, 171.6165), (96.6871, 164.2464), (107.6871, 167.9314)), ('horizontal', '100', (88.8835, 171.6165), (96.2536, 171.6165), (92.5686, 182.6165)), ('vertical', '100', (88.8835, 171.6165), (88.8835, 164.2464), (99.8835, 167.9314)), ('vertical', '5.8824', (88.45, 171.6165), (88.8835, 171.6165), (88.6668, 182.6165)), ('vertical', '5.8824', (88.8835, 172.05), (88.8835, 171.6165), (99.8835, 171.8332)), ('radius', 'R5.8824', (88.8835, 171.6165), 0.4335, 45), ('horizontal', '1192.16', (198.55, 171.6165), (110.6871, 171.6165), (154.6186, 160.6165))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0078_00784614_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0085_00857355","images":["images/0085_00857355.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 7 straight edges. It is extruded to a thickness of 1.04 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.2860337490829647\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(156.812861, 107.071489), (156.812861, 77.289655), (200.131893, 77.289655), (200.131893, 172.050037), (71.528518, 172.050037), (71.528518, 128.731005), (136.507065, 128.731005)], [(200.131893, 63.289655), (200.131893, 61.950036), (71.528518, 61.950036)], [(71.528518, 63.289655), (71.528518, 61.950036)], [(200.131893, 63.289655), (71.528518, 63.289655)], [(215.471511, 128.731005), (215.471511, 128.054145), (215.471511, 127.377285), (215.471511, 126.700425), (215.471511, 126.023565), (215.471511, 125.346706), (215.471511, 124.669846), (215.471511, 123.992986), (215.471511, 123.316126), (215.471511, 122.639266), (215.471511, 121.962406), (215.471511, 121.285546), (215.471511, 120.608687), (215.471511, 119.931827), (215.471511, 119.254967), (215.471511, 118.578107), (215.471511, 117.901247), (215.471511, 117.224387), (215.471511, 116.547527), (215.471511, 115.870667), (215.471511, 115.193808), (215.471511, 114.516948), (215.471511, 113.840088), (215.471511, 113.163228), (215.471511, 112.486368), (215.471511, 111.809508), (215.471511, 111.132648), (215.471511, 110.455789), (215.471511, 109.778929), (215.471511, 109.102069), (215.471511, 108.425209), (215.471511, 107.748349), (215.471511, 107.071489)], [(214.131893, 107.071489), (215.471511, 107.071489)], [(214.131893, 128.731005), (214.131893, 128.054145), (214.131893, 127.377285), (214.131893, 126.700425), (214.131893, 126.023565), (214.131893, 125.346706), (214.131893, 124.669846), (214.131893, 123.992986), (214.131893, 123.316126), (214.131893, 122.639266), (214.131893, 121.962406), (214.131893, 121.285546), (214.131893, 120.608687), (214.131893, 119.931827), (214.131893, 119.254967), (214.131893, 118.578107), (214.131893, 117.901247), (214.131893, 117.224387), (214.131893, 116.547527), (214.131893, 115.870667), (214.131893, 115.193808), (214.131893, 114.516948), (214.131893, 113.840088), (214.131893, 113.163228), (214.131893, 112.486368), (214.131893, 111.809508), (214.131893, 111.132648), (214.131893, 110.455789), (214.131893, 109.778929), (214.131893, 109.102069), (214.131893, 108.425209), (214.131893, 107.748349), (214.131893, 107.071489)], [(215.471511, 107.071489), (215.471511, 77.289655)], [(214.131893, 77.289655), (215.471511, 77.289655)], [(214.131893, 107.071489), (214.131893, 77.289655)], [(214.131893, 172.050037), (215.471511, 172.050037), (215.471511, 128.731005)], [(214.131893, 128.731005), (215.471511, 128.731005)], [(214.131893, 172.050037), (214.131893, 128.731005)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(135.830205, 107.748349, 20.99357, -1.84761, 88.15239)]\nHIDDEN_SEGMENTS = [(136.5071, 63.2896, 136.5071, 61.95), (156.8128, 63.2896, 156.8128, 61.95), (156.8238, 61.95, 156.8238, 63.2896)]\nDIMENSIONS = [('horizontal', '33.6842', (156.8129, 77.2897), (200.1319, 77.2897), (178.4724, 88.2897)), ('horizontal', '50.5263', (71.5285, 128.731), (136.507, 128.731), (104.0178, 139.731)), ('horizontal', '100', (200.1319, 172.05), (71.5285, 172.05), (135.8302, 161.05)), ('vertical', '23.1579', (156.8129, 107.0715), (156.8129, 77.2897), (167.8129, 92.1806)), ('vertical', '33.6842', (71.5285, 172.05), (71.5285, 128.731), (82.5285, 150.3905)), ('vertical', '73.6842', (200.1319, 77.2897), (200.1319, 172.05), (189.1319, 124.6698)), ('radius', 'R16.3243', (135.8302, 107.7483), 20.9936, 45), ('horizontal', '1.0417', (214.1319, 128.731), (215.4715, 128.731), (214.8017, 139.731))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0085_00857355_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0086_00869010","images":["images/0086_00869010.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 110.84 x 50.6 mm. It is extruded to a thickness of -3662.65 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.025829987046629654\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(87.905392, 170.556218), (90.48839, 170.556218)], [(90.675113, 170.742941), (90.675113, 171.863277)], [(90.48839, 172.05), (87.905392, 172.05)], [(87.718669, 171.863277), (87.718669, 170.742941)], [(90.581752, 170.836302), (90.581752, 171.769916)], [(87.998753, 170.649579), (90.395029, 170.649579)], [(87.81203, 170.836302), (87.718669, 170.742941)], [(87.81203, 171.769916), (87.81203, 170.836302)], [(90.395029, 171.956639), (87.998753, 171.956639)], [(90.675113, 61.95), (90.675113, 156.556218), (90.48839, 156.556218)], [(90.675113, 61.95), (90.48839, 61.95)], [(90.48839, 156.556218), (87.905392, 156.556218)], [(90.48839, 61.95), (87.905392, 61.95)], [(87.905392, 156.556218), (87.718669, 156.556218)], [(87.718669, 61.95), (87.718669, 156.556218)], [(87.905392, 61.95), (87.718669, 61.95)], [(90.48839, 61.95), (90.48839, 156.556218)], [(87.905392, 61.95), (87.905392, 156.556218)], [(104.675113, 170.742941), (104.675113, 170.556218)], [(199.281331, 170.556218), (104.675113, 170.556218)], [(199.281331, 170.742941), (199.281331, 170.556218)], [(199.281331, 172.05), (104.675113, 172.05), (104.675113, 171.863277)], [(199.281331, 172.05), (199.281331, 171.863277)], [(104.675113, 171.863277), (104.675113, 170.742941)], [(199.281331, 171.863277), (199.281331, 170.742941), (104.675113, 170.742941)], [(199.281331, 171.863277), (104.675113, 171.863277)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(87.905392, 170.742941, 0.186723, 180.0, -90.0), (90.48839, 170.742941, 0.186723, -90.0, -0.0), (90.48839, 171.863277, 0.186723, -0.0, 90.0), (87.905392, 171.863277, 0.186723, 90.0, 180.0), (90.395029, 171.769916, 0.186723, -0.0, 90.0), (90.395029, 170.836302, 0.186723, -90.0, -0.0), (87.905392, 170.836302, 0.208762, -153.434949, -63.434949), (87.998753, 171.769916, 0.186723, 90.0, -180.0)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (87.9054, 170.5562), (90.4884, 170.5562), (89.1969, 181.5562)), ('vertical', '43.3735', (90.6751, 170.7429), (90.6751, 171.8633), (79.6751, 171.3031)), ('horizontal', '110.843', (87.7187, 170.6496), (90.5818, 170.6496), (89.1502, 181.6496)), ('vertical', '50.6024', (87.7187, 170.6496), (87.7187, 171.9566), (76.7187, 171.3031)), ('vertical', '3.6145', (87.7187, 170.5562), (87.7187, 170.6496), (76.7187, 170.6029)), ('radius', 'R7.2289', (87.9054, 170.7429), 0.1867, 45), ('radius', 'R8.0822', (87.9054, 170.8363), 0.2088, 135), ('radius', 'R7.2289', (90.395, 170.8363), 0.1867, 45), ('horizontal', '3662.65', (199.2813, 170.7429), (104.6751, 170.7429), (151.9782, 159.7429))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0086_00869010_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0090_00909851","images":["images/0090_00909851.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring 2 circular holes, each of diameter 4.44 mm and 3 polygonal cutouts. It is extruded to a thickness of 1.74 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8014909090908572\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (64.775442, 66.169977, 178.7455, 180.140036, 111.312773, 164.771795, 106.860045, 160.292773, 84.622705, 126.452045, 169.224523, 164.7455, 80.169977, 117.546591, 114.90125, 128.259432)\nVISIBLE_SEGMENTS = _segments([[(C4, C10), (C7, C10)], [(C11, C5), (C11, C8)], [(C7, C12), (C4, C12)], [(C6, C8), (C6, C5)], [(113.675976, 132.964118), (C6, C5)], [(C13, C14), (113.675976, 132.964118)], [(C13, 98.871432), (C13, C14)], [(122.889864, 97.090341), (118.437136, 97.090341)], [(124.670955, C14), (124.670955, 98.871432)], [(118.437136, 116.682341), (122.889864, 116.682341)], [(123.276026, 139.537819), (C13, C14)], [(C9, 153.194705), (123.276026, 139.537819)], [(C9, 130.040523), (C9, 153.194705)], [(134.583497, C15), (127.342591, C15)], [(158.511682, C15), (134.583497, C15)], [(159.402227, 153.194705), (159.402227, 130.040523)], [(127.342591, 154.08525), (158.511682, 154.08525)], [(131.795318, 112.229614), (131.795318, 102.433614)], [(127.342591, 114.010705), (130.904773, 114.010705)], [(C9, 130.040523), (C9, 129.149977), (C9, 102.433614)], [(130.904773, 100.652523), (127.342591, 100.652523)], [(C6, C0), (106.999193, C0), (107.138341, C0), (107.277489, C0), (107.416636, C0), (107.555784, C0), (107.694932, C0), (107.83408, C0), (107.973227, C0), (108.112375, C0), (108.251523, C0), (108.39067, C0), (108.529818, C0), (108.668966, C0), (108.808114, C0), (108.947261, C0), (109.086409, C0), (109.225557, C0), (109.364705, C0), (109.503852, C0), (109.643, C0), (109.782148, C0), (109.921295, C0), (110.060443, C0), (110.199591, C0), (110.338739, C0), (110.477886, C0), (110.617034, C0), (110.756182, C0), (110.89533, C0), (111.034477, C0), (111.173625, C0), (C4, C0)], [(C6, C1), (106.999193, C1), (107.138341, C1), (107.277489, C1), (107.416636, C1), (107.555784, C1), (107.694932, C1), (107.83408, C1), (107.973227, C1), (108.112375, C1), (108.251523, C1), (108.39067, C1), (108.529818, C1), (108.668966, C1), (108.808114, C1), (108.947261, C1), (109.086409, C1), (109.225557, C1), (109.364705, C1), (109.503852, C1), (109.643, C1), (109.782148, C1), (109.921295, C1), (110.060443, C1), (110.199591, C1), (110.338739, C1), (110.477886, C1), (110.617034, C1), (110.756182, C1), (110.89533, C1), (111.034477, C1), (111.173625, C1), (C4, C1)], [(C6, C0), (C6, C1)], [(C4, C1), (C7, C1)], [(C4, C0), (C7, C0), (160.43192, C0), (160.571068, C0), (160.710216, C0), (160.849364, C0), (160.988511, C0), (161.127659, C0), (161.266807, C0), (161.405955, C0), (161.545102, C0), (161.68425, C0), (161.823398, C0), (161.962545, C0), (162.101693, C0), (162.240841, C0), (162.379989, C0), (162.519136, C0), (162.658284, C0), (162.797432, C0), (162.93658, C0), (163.075727, C0), (163.214875, C0), (163.354023, C0), (163.49317, C0), (163.632318, C0), (163.771466, C0), (163.910614, C0), (164.049761, C0), (164.188909, C0), (164.328057, C0), (164.467205, C0), (164.606352, C0), (C11, C0), (C11, C1)], [(C4, C0), (C4, C1)], [(C7, C0), (C7, C1)], [(C3, C5), (C3, 164.910943), (C3, 165.050091), (C3, 165.189239), (C3, 165.328386), (C3, 165.467534), (C3, 165.606682), (C3, 165.74583), (C3, 165.884977), (C3, 166.024125), (C3, 166.163273), (C3, 166.30242), (C3, 166.441568), (C3, 166.580716), (C3, 166.719864), (C3, 166.859011), (C3, 166.998159), (C3, 167.137307), (C3, 167.276455), (C3, 167.415602), (C3, 167.55475), (C3, 167.693898), (C3, 167.833045), (C3, 167.972193), (C3, 168.111341), (C3, 168.250489), (C3, 168.389636), (C3, 168.528784), (C3, 168.667932), (C3, 168.80708), (C3, 168.946227), (C3, 169.085375), (C3, C10), (C2, C10)], [(C2, C5), (C2, 164.910943), (C2, 165.050091), (C2, 165.189239), (C2, 165.328386), (C2, 165.467534), (C2, 165.606682), (C2, 165.74583), (C2, 165.884977), (C2, 166.024125), (C2, 166.163273), (C2, 166.30242), (C2, 166.441568), (C2, 166.580716), (C2, 166.719864), (C2, 166.859011), (C2, 166.998159), (C2, 167.137307), (C2, 167.276455), (C2, 167.415602), (C2, 167.55475), (C2, 167.693898), (C2, 167.833045), (C2, 167.972193), (C2, 168.111341), (C2, 168.250489), (C2, 168.389636), (C2, 168.528784), (C2, 168.667932), (C2, 168.80708), (C2, 168.946227), (C2, 169.085375), (C2, C10)], [(C3, C12), (C2, C12)], [(C2, C8), (C2, C5)], [(C3, C8), (C3, C5), (C2, C5)], [(C3, C8), (C2, C8)]])\nVISIBLE_CIRCLES = [(135.3575, 166.552886, 1.781091), (135.3575, 82.841614, 1.781091)]\nVISIBLE_ARCS = [(111.312773, 164.771795, 4.452727, 90.0, 180.0), (160.292773, 164.771795, 4.452727, -0.0, 90.0), (160.292773, 84.622705, 4.452727, -90.0, -0.0), (111.312773, 84.622705, 4.452727, -180.0, -90.0), (118.882409, 98.426159, 1.408076, 161.565051, -108.434949), (122.889864, 98.871432, 1.781091, -90.0, 0.0), (122.889864, 114.90125, 1.781091, -0.0, 90.0), (88.603864, 134.938523, 34.975882, -31.464144, 7.556227), (88.603864, 134.938523, 34.975882, 7.556227, 23.104412), (88.603864, 134.938523, 34.975882, 23.104412, 58.535856), (127.787864, 129.59525, 1.408076, 161.565051, -161.565051), (127.787864, 129.59525, 1.408076, -161.565051, -108.434949), (158.066409, 129.59525, 1.408076, -71.565051, 18.434949), (158.511682, 153.194705, 0.890545, -0.0, 90.0), (142.036591, 129.59525, 28.560002, 120.963757, 138.114049), (142.036591, 129.59525, 28.560002, 138.114049, 173.225758), (142.036591, 129.59525, 28.560002, 173.225758, -149.036243), (130.4595, 101.988341, 1.408076, -71.565051, 18.434949), (130.4595, 112.674886, 1.408076, -18.434949, 71.565051), (107.305318, 133.157432, 27.714427, -43.698047, -10.179411), (107.305318, 133.157432, 27.714427, -10.179411, 46.301953), (127.787864, 101.988341, 1.408076, 161.565051, -108.434949), (200.583321, -6443.857966, 6510.138973, 90.315411, 90.354599), (3900.314055, 162.40022, 3721.0346, -178.802294, -178.733748), (8231.973234, 10.2313, 8053.551346, 179.470747, 179.502424)]\nHIDDEN_SEGMENTS = [(118.4371, 64.7755, 118.4371, 66.17), (124.6709, 64.7755, 124.6709, 66.17), (117.5466, 64.7755, 117.5466, 66.17), (127.3426, 64.7755, 127.3426, 66.17), (159.4022, 64.7755, 159.4022, 66.17), (158.5116, 64.7755, 158.5116, 66.17), (126.452, 64.7755, 126.452, 66.17), (130.9047, 64.7755, 130.9047, 66.17), (131.7953, 64.7755, 131.7953, 66.17), (137.1386, 64.7755, 137.1386, 66.17), (123.5797, 66.17, 123.5797, 64.7755), (117.4743, 66.17, 117.4743, 64.7755), (113.4765, 66.17, 113.4765, 64.7755), (159.4744, 66.17, 159.4744, 64.7755), (126.3797, 66.17, 126.3797, 64.7755), (131.8675, 66.17, 131.8675, 64.7755), (135.0197, 66.17, 135.0197, 64.7755), (133.5764, 66.17, 133.5764, 64.7755), (180.14, 116.6824, 178.7455, 116.6824), (180.14, 97.0904, 178.7455, 97.0904), (180.14, 98.8714, 178.7455, 98.8714), (180.14, 114.9013, 178.7455, 114.9013), (180.14, 154.0853, 178.7455, 154.0853), (180.14, 130.0405, 178.7455, 130.0405), (180.14, 128.2594, 178.7455, 128.2594), (180.14, 153.1947, 178.7455, 153.1947), (180.14, 100.6525, 178.7455, 100.6525), (180.14, 102.4336, 178.7455, 102.4336), (180.14, 112.2296, 178.7455, 112.2296), (180.14, 114.0107, 178.7455, 114.0107), (178.7455, 168.334, 180.14, 168.334), (178.7455, 81.0605, 180.14, 81.0605)]\nDIMENSIONS = [('horizontal', '61.1111', (111.3128, 169.2246), (160.2927, 169.2246), (135.8028, 180.2246)), ('vertical', '100', (164.7454, 164.7718), (164.7454, 84.6227), (175.7454, 124.6973)), ('diameter', '%%c4.4444', (135.3575, 166.5529), 1.7811, 45), ('horizontal', '35.5556', (106.86, 166.5529), (135.3575, 166.5529), (121.1087, 177.5529)), ('vertical', '3.3334', (135.3575, 169.2246), (135.3575, 166.5529), (146.3575, 167.8887)), ('diameter', '%%c4.4444', (135.3575, 82.8416), 1.7811, 45), ('horizontal', '35.5556', (106.86, 82.8416), (135.3575, 82.8416), (121.1087, 93.8416)), ('vertical', '107.778', (135.3575, 169.2246), (135.3575, 82.8416), (146.3575, 126.0331)), ('horizontal', '22.2222', (106.86, 164.7718), (124.6709, 164.7718), (115.7654, 175.7718)), ('vertical', '84.4444', (106.86, 164.7718), (106.86, 97.0904), (117.86, 130.9311)), ('vertical', '5.5556', (106.86, 169.2246), (106.86, 164.7718), (117.86, 166.9982)), ('horizontal', '52.2223', (117.5465, 154.0853), (159.4022, 154.0853), (138.4744, 165.0853)), ('vertical', '48.8889', (117.5465, 154.0853), (117.5465, 114.9013), (128.5465, 134.4933)), ('horizontal', '13.3333', (106.86, 154.0853), (117.5465, 154.0853), (112.2033, 165.0853)), ('vertical', '18.8889', (117.5465, 169.2246), (117.5465, 154.0853), (128.5465, 161.6549)), ('horizontal', '6.6666', (126.452, 153.1948), (131.7953, 153.1948), (129.1236, 164.1948)), ('vertical', '65.5556', (126.452, 153.1948), (126.452, 100.6525), (137.452, 126.9236)), ('horizontal', '24.4445', (106.86, 153.1948), (126.452, 153.1948), (116.656, 164.1948)), ('vertical', '20', (126.452, 169.2246), (126.452, 153.1948), (137.452, 161.2097)), ('radius', 'R5.5556', (111.3128, 164.7718), 4.4528, 45), ('radius', 'R43.6385', (88.6038, 134.9386), 34.9759, 45), ('radius', 'R2.2222', (122.8898, 114.9013), 1.7811, 45), ('radius', 'R1.7568', (118.8824, 98.4262), 1.4081, 45), ('radius', 'R35.6336', (142.0365, 129.5953), 28.56, 45), ('radius', 'R1.1111', (158.5117, 153.1948), 0.8905, 45), ('radius', 'R34.5786', (107.3053, 133.1575), 27.7144, 45), ('horizontal', '1.7399', (180.14, 164.7718), (178.7455, 164.7718), (179.4427, 153.7718))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0090_00909851_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0093_00934560","images":["images/0093_00934560.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 165.52 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4828453477480201\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(80.960018, 172.283265), (122.637195, 172.283265), (122.637195, 175.332815), (74.35266, 175.332815)], [(74.35266, 145.152045), (74.10834, 145.152045), (73.86402, 145.152045), (73.6197, 145.152045), (73.37538, 145.152045), (73.13106, 145.152045), (72.88674, 145.152045), (72.64242, 145.152045), (72.3981, 145.152045), (72.15378, 145.152045), (71.90946, 145.152045), (71.66514, 145.152045), (71.42082, 145.152045), (71.1765, 145.152045), (70.93218, 145.152045), (70.68786, 145.152045), (70.44354, 145.152045), (70.19922, 145.152045), (69.9549, 145.152045), (69.71058, 145.152045), (69.466259, 145.152045), (69.221939, 145.152045), (68.977619, 145.152045), (68.733299, 145.152045), (68.488979, 145.152045), (68.244659, 145.152045), (68.000339, 145.152045), (67.756019, 145.152045), (67.511699, 145.152045), (67.267379, 145.152045), (67.023059, 145.152045), (66.778739, 145.152045), (66.534419, 145.152045)], [(74.35266, 65.232815), (74.10834, 65.232815), (73.86402, 65.232815), (73.6197, 65.232815), (73.37538, 65.232815), (73.13106, 65.232815), (72.88674, 65.232815), (72.64242, 65.232815), (72.3981, 65.232815), (72.15378, 65.232815), (71.90946, 65.232815), (71.66514, 65.232815), (71.42082, 65.232815), (71.1765, 65.232815), (70.93218, 65.232815), (70.68786, 65.232815), (70.44354, 65.232815), (70.19922, 65.232815), (69.9549, 65.232815), (69.71058, 65.232815), (69.466259, 65.232815), (69.221939, 65.232815), (68.977619, 65.232815), (68.733299, 65.232815), (68.488979, 65.232815), (68.244659, 65.232815), (68.000339, 65.232815), (67.756019, 65.232815), (67.511699, 65.232815), (67.267379, 65.232815), (67.023059, 65.232815), (66.778739, 65.232815), (66.534419, 65.232815)], [(74.35266, 145.152045), (74.35266, 65.232815)], [(122.637195, 145.152045), (122.637195, 65.232815), (74.35266, 65.232815)], [(122.637195, 145.152045), (74.35266, 145.152045)], [(66.534419, 65.232815), (66.534419, 145.152045)], [(136.637195, 175.332815), (136.637195, 174.827166), (136.637195, 174.321517), (136.637195, 173.815868), (136.637195, 173.310219), (136.637195, 172.80457), (136.637195, 172.29892), (136.637195, 171.793271), (136.637195, 171.287622), (136.637195, 170.781973), (136.637195, 170.276324), (136.637195, 169.770675), (136.637195, 169.265026), (136.637195, 168.759377), (136.637195, 168.253728), (136.637195, 167.748079), (136.637195, 167.24243), (136.637195, 166.736781), (136.637195, 166.231132), (136.637195, 165.725483), (136.637195, 165.219834), (136.637195, 164.714185), (136.637195, 164.208535), (136.637195, 163.702886), (136.637195, 163.197237), (136.637195, 162.691588), (136.637195, 162.185939), (136.637195, 161.68029), (136.637195, 161.174641), (136.637195, 160.668992), (136.637195, 160.163343), (136.637195, 159.657694), (136.637195, 159.152045)], [(216.556425, 175.332815), (216.556425, 174.827166), (216.556425, 174.321517), (216.556425, 173.815868), (216.556425, 173.310219), (216.556425, 172.80457), (216.556425, 172.29892), (216.556425, 171.793271), (216.556425, 171.287622), (216.556425, 170.781973), (216.556425, 170.276324), (216.556425, 169.770675), (216.556425, 169.265026), (216.556425, 168.759377), (216.556425, 168.253728), (216.556425, 167.748079), (216.556425, 167.24243), (216.556425, 166.736781), (216.556425, 166.231132), (216.556425, 165.725483), (216.556425, 165.219834), (216.556425, 164.714185), (216.556425, 164.208535), (216.556425, 163.702886), (216.556425, 163.197237), (216.556425, 162.691588), (216.556425, 162.185939), (216.556425, 161.68029), (216.556425, 161.174641), (216.556425, 160.668992), (216.556425, 160.163343), (216.556425, 159.657694), (216.556425, 159.152045)], [(136.637195, 175.332815), (216.556425, 175.332815)], [(216.556425, 159.152045), (136.637195, 159.152045)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(74.627132, 167.244758, 8.092713, 91.943609, 38.506109)]\nHIDDEN_SEGMENTS = [(80.96, 145.152, 80.96, 65.2328), (82.7199, 65.2328, 82.7199, 145.152), (136.6372, 172.2833, 216.5564, 172.2833)]\nDIMENSIONS = [('horizontal', '86.3158', (80.96, 172.2833), (122.6372, 172.2833), (101.7986, 183.2833)), ('horizontal', '100', (122.6372, 175.3328), (74.3527, 175.3328), (98.4949, 164.3328)), ('vertical', '6.3158', (122.6372, 172.2833), (122.6372, 175.3328), (111.6372, 173.808)), ('radius', 'R16.7605', (74.6271, 167.2448), 8.0927, 45), ('horizontal', '165.517', (136.6372, 175.3328), (216.5564, 175.3328), (176.5968, 186.3328))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0093_00934560_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0095_00958723","images":["images/0095_00958723.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 150.88 x 133.33 mm. It is extruded to a thickness of 5333.33 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.017472727272728347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(89.032424, 172.05), (90.779697, 172.05)], [(91.362121, 171.467576), (91.362121, 169.720303)], [(90.779697, 169.137879), (89.032424, 169.137879)], [(88.45, 169.720303), (88.45, 171.467576)], [(91.086236, 171.467576), (91.086236, 169.720303)], [(89.032424, 171.774115), (90.779697, 171.774115)], [(88.756539, 171.467576), (88.45, 171.467576)], [(88.756539, 169.720303), (88.756539, 171.467576)], [(90.779697, 169.444418), (89.032424, 169.444418)], [(88.45, 61.95), (89.032424, 61.95)], [(88.45, 155.137879), (89.032424, 155.137879)], [(88.45, 61.95), (88.45, 155.137879)], [(89.032424, 155.137879), (90.779697, 155.137879)], [(89.032424, 61.95), (90.779697, 61.95), (91.362121, 61.95), (91.362121, 155.137879)], [(90.779697, 155.137879), (91.362121, 155.137879)], [(89.032424, 61.95), (89.032424, 155.137879)], [(90.779697, 61.95), (90.779697, 155.137879)], [(198.55, 171.467576), (198.55, 172.05), (105.362121, 172.05)], [(105.362121, 171.467576), (105.362121, 172.05)], [(198.55, 169.137879), (105.362121, 169.137879)], [(198.55, 169.137879), (198.55, 169.720303)], [(105.362121, 169.137879), (105.362121, 169.720303), (105.362121, 171.467576)], [(198.55, 169.720303), (198.55, 171.467576), (105.362121, 171.467576)], [(198.55, 169.720303), (105.362121, 169.720303)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(89.032424, 171.467576, 0.582424, 90.0, 180.0), (90.779697, 171.467576, 0.582424, -0.0, 90.0), (90.779697, 169.720303, 0.582424, -90.0, -0.0), (89.032424, 169.720303, 0.582424, -180.0, -90.0), (90.795024, 169.73563, 0.291615, -93.012788, -3.012788), (90.779697, 171.467576, 0.306539, -0.0, 90.0), (88.894482, 171.329633, 0.465395, 72.758541, 162.758541), (89.032424, 169.720303, 0.275885, 180.0, -90.0)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (89.0324, 172.05), (90.7797, 172.05), (89.9061, 183.05)), ('vertical', '100', (91.3621, 171.4676), (91.3621, 169.7203), (102.3621, 170.5939)), ('horizontal', '150.877', (88.45, 171.7741), (91.0862, 171.7741), (89.7681, 182.7741)), ('vertical', '133.333', (88.45, 171.7741), (88.45, 169.4444), (99.45, 170.6093)), ('vertical', '15.7895', (88.45, 172.05), (88.45, 171.7741), (99.45, 171.9121)), ('radius', 'R33.3333', (89.0324, 171.4676), 0.5824, 45), ('radius', 'R26.6355', (88.8945, 171.3296), 0.4654, 45), ('radius', 'R17.5439', (90.7797, 171.4676), 0.3065, 135), ('radius', 'R16.6897', (90.795, 169.7356), 0.2916, 45), ('radius', 'R15.7895', (89.0324, 169.7203), 0.2759, 135), ('horizontal', '5333.33', (198.55, 171.4676), (105.3621, 171.4676), (151.9561, 160.4676))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0095_00958723_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0097_00970818","images":["images/0097_00970818.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 10.42 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.330777358490562\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(163.888908, 116.922907), (196.107728, 116.922907), (187.702818, 130.93109)], [(163.888908, 144.939272), (95.248812, 144.939272)], [(71.434902, 130.93109), (63.029992, 116.922907), (95.248812, 116.922907)], [(196.107728, 102.922907), (196.107728, 89.060643), (187.702818, 89.060643)], [(187.702818, 102.922907), (187.702818, 89.060643)], [(196.107728, 102.922907), (187.702818, 102.922907), (186.958634, 102.922907), (186.214449, 102.922907), (185.470264, 102.922907), (184.726079, 102.922907), (183.981895, 102.922907), (183.23771, 102.922907), (182.493525, 102.922907), (181.749341, 102.922907), (181.005156, 102.922907), (180.260971, 102.922907), (179.516786, 102.922907), (178.772602, 102.922907), (178.028417, 102.922907), (177.284232, 102.922907), (176.540048, 102.922907), (175.795863, 102.922907), (175.051678, 102.922907), (174.307494, 102.922907), (173.563309, 102.922907), (172.819124, 102.922907), (172.074939, 102.922907), (171.330755, 102.922907), (170.58657, 102.922907), (169.842385, 102.922907), (169.098201, 102.922907), (168.354016, 102.922907), (167.609831, 102.922907), (166.865646, 102.922907), (166.121462, 102.922907), (165.377277, 102.922907), (164.633092, 102.922907), (163.888908, 102.922907)], [(187.702818, 89.060643), (186.958634, 89.060643), (186.214449, 89.060643), (185.470264, 89.060643), (184.726079, 89.060643), (183.981895, 89.060643), (183.23771, 89.060643), (182.493525, 89.060643), (181.749341, 89.060643), (181.005156, 89.060643), (180.260971, 89.060643), (179.516786, 89.060643), (178.772602, 89.060643), (178.028417, 89.060643), (177.284232, 89.060643), (176.540048, 89.060643), (175.795863, 89.060643), (175.051678, 89.060643), (174.307494, 89.060643), (173.563309, 89.060643), (172.819124, 89.060643), (172.074939, 89.060643), (171.330755, 89.060643), (170.58657, 89.060643), (169.842385, 89.060643), (169.098201, 89.060643), (168.354016, 89.060643), (167.609831, 89.060643), (166.865646, 89.060643), (166.121462, 89.060643), (165.377277, 89.060643), (164.633092, 89.060643), (163.888908, 89.060643), (95.248812, 89.060643)], [(163.888908, 102.922907), (95.248812, 102.922907), (94.504628, 102.922907), (93.760443, 102.922907), (93.016258, 102.922907), (92.272073, 102.922907), (91.527889, 102.922907), (90.783704, 102.922907), (90.039519, 102.922907), (89.295335, 102.922907), (88.55115, 102.922907), (87.806965, 102.922907), (87.062781, 102.922907), (86.318596, 102.922907), (85.574411, 102.922907), (84.830226, 102.922907), (84.086042, 102.922907), (83.341857, 102.922907), (82.597672, 102.922907), (81.853488, 102.922907), (81.109303, 102.922907), (80.365118, 102.922907), (79.620933, 102.922907), (78.876749, 102.922907), (78.132564, 102.922907), (77.388379, 102.922907), (76.644195, 102.922907), (75.90001, 102.922907), (75.155825, 102.922907), (74.41164, 102.922907), (73.667456, 102.922907), (72.923271, 102.922907), (72.179086, 102.922907), (71.434902, 102.922907), (71.434902, 89.060643)], [(95.248812, 89.060643), (94.504628, 89.060643), (93.760443, 89.060643), (93.016258, 89.060643), (92.272073, 89.060643), (91.527889, 89.060643), (90.783704, 89.060643), (90.039519, 89.060643), (89.295335, 89.060643), (88.55115, 89.060643), (87.806965, 89.060643), (87.062781, 89.060643), (86.318596, 89.060643), (85.574411, 89.060643), (84.830226, 89.060643), (84.086042, 89.060643), (83.341857, 89.060643), (82.597672, 89.060643), (81.853488, 89.060643), (81.109303, 89.060643), (80.365118, 89.060643), (79.620933, 89.060643), (78.876749, 89.060643), (78.132564, 89.060643), (77.388379, 89.060643), (76.644195, 89.060643), (75.90001, 89.060643), (75.155825, 89.060643), (74.41164, 89.060643), (73.667456, 89.060643), (72.923271, 89.060643), (72.179086, 89.060643), (71.434902, 89.060643), (63.029992, 89.060643)], [(63.029992, 102.922907), (63.029992, 89.060643)], [(71.434902, 102.922907), (63.029992, 102.922907)], [(163.888908, 102.922907), (163.888908, 89.060643)], [(95.248812, 102.922907), (95.248812, 89.060643)], [(210.107728, 144.939272), (223.969992, 144.939272)], [(210.107728, 144.939272), (210.107728, 144.501517), (210.107728, 144.063761), (210.107728, 143.626005), (210.107728, 143.18825), (210.107728, 142.750494), (210.107728, 142.312738), (210.107728, 141.874982), (210.107728, 141.437227), (210.107728, 140.999471), (210.107728, 140.561715), (210.107728, 140.12396), (210.107728, 139.686204), (210.107728, 139.248448), (210.107728, 138.810692), (210.107728, 138.372937), (210.107728, 137.935181), (210.107728, 137.497425), (210.107728, 137.05967), (210.107728, 136.621914), (210.107728, 136.184158), (210.107728, 135.746402), (210.107728, 135.308647), (210.107728, 134.870891), (210.107728, 134.433135), (210.107728, 133.99538), (210.107728, 133.557624), (210.107728, 133.119868), (210.107728, 132.682112), (210.107728, 132.244357), (210.107728, 131.806601), (210.107728, 131.368845), (210.107728, 130.93109), (223.969992, 130.93109)], [(223.969992, 144.939272), (223.969992, 144.501517), (223.969992, 144.063761), (223.969992, 143.626005), (223.969992, 143.18825), (223.969992, 142.750494), (223.969992, 142.312738), (223.969992, 141.874982), (223.969992, 141.437227), (223.969992, 140.999471), (223.969992, 140.561715), (223.969992, 140.12396), (223.969992, 139.686204), (223.969992, 139.248448), (223.969992, 138.810692), (223.969992, 138.372937), (223.969992, 137.935181), (223.969992, 137.497425), (223.969992, 137.05967), (223.969992, 136.621914), (223.969992, 136.184158), (223.969992, 135.746402), (223.969992, 135.308647), (223.969992, 134.870891), (223.969992, 134.433135), (223.969992, 133.99538), (223.969992, 133.557624), (223.969992, 133.119868), (223.969992, 132.682112), (223.969992, 132.244357), (223.969992, 131.806601), (223.969992, 131.368845), (223.969992, 130.93109), (223.969992, 116.922907)], [(210.107728, 116.922907), (223.969992, 116.922907)], [(210.107728, 130.93109), (210.107728, 116.922907)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(129.56886, 96.920587, 39.723525, 30.234375, 149.765625), (163.778219, 117.505187, 27.434309, 29.30008, 89.76883), (95.359501, 117.505187, 27.434309, 90.23117, 150.69992)]\nHIDDEN_SEGMENTS = [(223.97, 136.6442, 210.1077, 136.6442)]\nDIMENSIONS = [('horizontal', '51.5789', (163.889, 144.9393), (95.2488, 144.9393), (129.5689, 133.9393)), ('horizontal', '100', (63.03, 116.9229), (196.1077, 116.9229), (129.5689, 127.9229)), ('aligned', '12.2757', (196.1077, 116.9229), (187.7028, 130.9311), (182.4729, 118.2676)), ('aligned', '12.2757', (71.4349, 130.9311), (63.03, 116.9229), (76.6649, 118.2676)), ('radius', 'R29.8499', (129.5689, 96.9206), 39.7236, 45), ('radius', 'R20.6153', (163.7782, 117.5052), 27.4344, 45), ('horizontal', '10.4167', (210.1077, 116.9229), (223.97, 116.9229), (217.0389, 127.9229))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0097_00970818_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0097_00975256","images":["images/0097_00975256.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 131.34 x 120.9 mm. It is extruded to a thickness of 3402.99 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.02711031578947265\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(89.01631, 172.05), (91.727341, 172.05)], [(92.293826, 171.483516), (92.293826, 168.812947)], [(91.727341, 168.206), (89.01631, 168.206)], [(88.449826, 168.812947), (88.449826, 171.483516)], [(92.010583, 171.483516), (92.010583, 168.812947)], [(89.01631, 171.766758), (91.727341, 171.766758)], [(88.733068, 171.483516), (88.449826, 171.483516)], [(88.733068, 168.812947), (88.733068, 171.483516)], [(91.727341, 168.489242), (89.01631, 168.489242)], [(88.449826, 61.95), (89.01631, 61.95)], [(88.449826, 154.206), (89.01631, 154.206)], [(88.449826, 61.95), (88.449826, 154.206)], [(89.01631, 154.206), (91.727341, 154.206)], [(89.01631, 61.95), (91.727341, 61.95), (92.293826, 61.95), (92.293826, 154.206)], [(91.727341, 154.206), (92.293826, 154.206)], [(92.293826, 61.95), (92.294174, 61.95)], [(92.293826, 154.206), (92.294174, 154.206)], [(88.449826, 61.95), (88.449477, 61.95)], [(88.449826, 154.206), (88.449477, 154.206)], [(92.294174, 154.206), (92.294174, 61.95)], [(88.449477, 154.206), (88.449477, 61.95)], [(89.01631, 61.95), (89.01631, 154.206)], [(91.727341, 61.95), (91.727341, 154.206)], [(198.550174, 171.483516), (198.550174, 172.05), (106.294174, 172.05)], [(106.294174, 171.483516), (106.294174, 172.05)], [(198.550174, 168.206), (106.294174, 168.206)], [(198.550174, 168.206), (198.550174, 168.812947), (106.294174, 168.812947)], [(106.294174, 168.206), (106.294174, 168.812947), (106.294174, 171.483516)], [(198.550174, 168.812947), (198.550174, 171.483516), (106.294174, 171.483516)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(89.01631, 171.483516, 0.566484, 90.0, 180.0), (91.727341, 171.483516, 0.566484, -0.0, 90.0), (91.70711, 168.792716, 0.587065, -88.025066, 1.974934), (89.036541, 168.792716, 0.587065, 178.025066, -91.974934), (91.70711, 168.792716, 0.304147, -86.185925, 3.814075), (91.727341, 171.483516, 0.283242, -0.0, 90.0), (88.874689, 171.341895, 0.447845, 71.565051, 161.565051), (89.036541, 168.792716, 0.304147, 176.185925, -93.814075)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '100', (89.0163, 172.05), (91.7273, 172.05), (90.3718, 183.05)), ('vertical', '98.5075', (92.2938, 171.4835), (92.2938, 168.8129), (103.2938, 170.1482)), ('horizontal', '131.343', (88.4498, 171.7668), (92.0106, 171.7668), (90.2302, 182.7668)), ('vertical', '120.895', (88.4498, 171.7668), (88.4498, 168.4892), (99.4498, 170.128)), ('vertical', '10.4478', (88.4498, 172.05), (88.4498, 171.7668), (99.4498, 171.9084)), ('radius', 'R20.8955', (89.0163, 171.4835), 0.5665, 45), ('radius', 'R21.6547', (91.7071, 168.7927), 0.5871, 45), ('radius', 'R16.5194', (88.8747, 171.3419), 0.4478, 45), ('radius', 'R10.4478', (91.7273, 171.4835), 0.2832, 45), ('radius', 'R11.2189', (91.7071, 168.7927), 0.3041, 135), ('horizontal', '3402.99', (198.5502, 171.4835), (106.2942, 171.4835), (152.4222, 160.4835))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0097_00975256_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0004_00048846","images":["images/0004_00048846.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 30.53 mm wide and 100 mm tall. It is extruded to a thickness of 148.72 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 58.97 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 58.97 mm. A union feature: The part is a rectangular plate 31.17 mm wide and 86.91 mm tall. It is extruded to a thickness of 58.97 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3123250000000129\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(104.173907, 140.8175), (104.173907, 143.149298)], [(104.173907, 170.434737), (104.173907, 172.05)], [(94.639775, 140.8175), (104.173907, 140.8175)], [(104.173907, 172.05), (94.639775, 172.05)], [(94.639775, 143.22), (94.639775, 140.8175)], [(94.639775, 172.05), (94.639775, 170.364035), (94.639775, 169.6475)], [(104.376223, 169.601572), (104.376223, 170.364035)], [(104.376223, 143.22), (104.376223, 143.265928)], [(104.173907, 126.8175), (104.173907, 80.369167), (94.639775, 80.369167)], [(94.639775, 126.8175), (94.639775, 80.369167)], [(104.173907, 126.8175), (94.639775, 126.8175)], [(113.555948, 80.369167), (104.376223, 80.369167), (104.173907, 80.369167)], [(94.639775, 80.369167), (94.639775, 61.95)], [(104.376223, 61.95), (94.639775, 61.95)], [(104.376223, 80.369167), (104.376223, 61.95)], [(94.639775, 80.369167), (85.333603, 80.369167)], [(94.639775, 61.95), (85.333603, 61.95)], [(113.555948, 61.95), (104.376223, 61.95)], [(85.333603, 61.95), (85.333603, 80.369167)], [(113.555948, 61.95), (113.555948, 80.369167)], [(127.555948, 140.8175), (174.004282, 140.8175)], [(127.555948, 172.05), (174.004282, 172.05)], [(127.555948, 172.05), (127.555948, 140.8175)], [(174.004282, 143.22), (174.004282, 140.8175)], [(174.004282, 172.05), (174.004282, 170.364035), (192.423448, 170.364035), (192.423448, 169.6475)], [(174.004282, 169.6475), (192.423448, 169.6475)], [(192.423448, 143.22), (192.423448, 142.375283)], [(192.423448, 171.208752), (192.423448, 170.364035)], [(174.004282, 169.6475), (174.004282, 143.22)], [(192.423448, 169.6475), (192.423448, 143.22)], [(192.423448, 142.375283), (174.004282, 142.375283)], [(192.423448, 171.208752), (174.004282, 171.208752)], [(174.004282, 143.22), (192.423448, 143.22)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(99.507999, 156.825774, 14.450491, -109.6875, -70.3125), (99.507999, 156.758261, 14.450491, 70.3125, 109.6875), (99.367731, 156.43375, 14.034128, 109.6875, -109.6875), (99.52182, 156.43375, 14.034128, -69.763265, 69.763265)]\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '30.5263', (104.1739, 172.05), (94.6398, 172.05), (99.4068, 161.05)), ('vertical', '100', (104.1739, 140.8175), (104.1739, 172.05), (93.1739, 156.4338)), ('radius', 'R44.9344', (99.3677, 156.4338), 14.0341, 45), ('radius', 'R44.9344', (99.5218, 156.4338), 14.0341, 135), ('horizontal', '31.1741', (94.6398, 143.22), (104.3762, 143.22), (99.508, 154.22)), ('vertical', '86.9096', (104.3762, 143.22), (104.3762, 170.364), (93.3762, 156.792)), ('vertical', '0', (94.6398, 140.8175), (94.6398, 140.8175), (94.6398, 140.8175)), ('vertical', '7.6923', (94.6398, 140.8175), (94.6398, 143.22), (83.6398, 142.0188)), ('radius', 'R46.2675', (99.508, 156.8258), 14.4505, 225), ('horizontal', '148.718', (127.5559, 140.8175), (174.0043, 140.8175), (150.7801, 151.8175)), ('horizontal', '58.9744', (174.0043, 169.6475), (192.4234, 169.6475), (183.2139, 180.6475)), ('horizontal', '58.9744', (174.0043, 143.22), (192.4234, 143.22), (183.2139, 154.22))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0004_00048846_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0026_00268188","images":["images/0026_00268188.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 41.36 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 41.36 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8440359386972757\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(66.977491, 164.094488), (151.355991, 166.1525)], [(139.007918, 116.760207), (66.977491, 116.760207), (66.977491, 164.094488)], [(151.355991, 67.8475), (164.525198, 67.8475)], [(151.355991, 102.760207), (164.525198, 102.760207)], [(151.355991, 67.8475), (151.355991, 102.760207)], [(66.977491, 67.8475), (66.977491, 102.760207), (151.355991, 102.760207)], [(66.977491, 67.8475), (151.355991, 67.8475)], [(164.525198, 102.760207), (164.525198, 67.8475)], [(213.437905, 166.1525), (178.525198, 166.1525)], [(213.437905, 164.094488), (178.525198, 164.094488), (178.525198, 166.1525)], [(213.437905, 164.094488), (213.437905, 166.1525)], [(213.437905, 116.760207), (178.525198, 116.760207)], [(213.437905, 116.760207), (213.437905, 164.094488)], [(178.525198, 116.760207), (178.525198, 164.094488)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(138.020205, 143.246791, 26.504994, -87.864368, 59.791882)]\nHIDDEN_SEGMENTS = [(139.0079, 67.8475, 139.0079, 102.7602)]\nDIMENSIONS = [('horizontal', '85.3405', (139.0079, 116.7602), (66.9775, 116.7602), (102.9927, 105.7602)), ('vertical', '56.0809', (66.9775, 116.7602), (66.9775, 164.0945), (55.9775, 140.4273)), ('aligned', '100', (66.9775, 164.0945), (151.356, 166.1525), (108.8985, 176.1202)), ('radius', 'R31.4027', (138.0202, 143.2468), 26.505, 45), ('horizontal', '99.9703', (66.9775, 166.1525), (151.356, 166.1525), (109.1668, 177.1525)), ('vertical', '58.5192', (151.356, 166.1525), (151.356, 116.7602), (162.356, 141.4563)), ('vertical', '0', (66.9775, 166.1525), (66.9775, 166.1525), (66.9775, 166.1525)), ('vertical', '0', (66.9775, 166.1525), (66.9775, 166.1525), (66.9775, 166.1525)), ('aligned', '100', (66.9775, 164.0945), (151.356, 166.1525), (108.8985, 176.1202)), ('radius', 'R31.4027', (138.0202, 143.2468), 26.505, 135), ('horizontal', '41.364', (213.4379, 166.1525), (178.5252, 166.1525), (195.9816, 155.1525)), ('horizontal', '41.364', (213.4379, 166.1525), (178.5252, 166.1525), (195.9816, 155.1525))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0026_00268188_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0028_00288910","images":["images/0028_00288910.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 18.95 mm tall. It is extruded to a thickness of 6.25 mm. A cut feature: The part is a rectangular plate 2.19 mm wide and 9.9 mm tall. It is extruded to a thickness of -2.08 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8079203539822983\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(174.371267, 118.870769), (174.371267, 134.178733)], [(93.579231, 118.870769), (174.371267, 118.870769)], [(174.371267, 134.178733), (93.579231, 134.178733), (93.579231, 118.870769)], [(95.262399, 130.236578), (95.262399, 122.237104)], [(97.029724, 129.5013), (97.029724, 130.236578)], [(172.688099, 129.5013), (97.029724, 129.5013)], [(172.688099, 123.920271), (172.688099, 129.5013)], [(97.029724, 123.920271), (172.688099, 123.920271)], [(97.029724, 122.237104), (97.029724, 123.920271)], [(97.029724, 129.5013), (97.029724, 123.920271)], [(174.371267, 104.870769), (174.371267, 99.821267), (93.579231, 99.821267)], [(93.579231, 104.870769), (93.579231, 99.821267)], [(174.371267, 104.870769), (93.579231, 104.870769)], [(188.371267, 118.870769), (193.420769, 118.870769)], [(188.371267, 134.178733), (193.420769, 134.178733)], [(188.371267, 134.178733), (188.371267, 118.870769)], [(193.420769, 134.178733), (193.420769, 118.870769)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(96.146061, 122.237104, 0.883663, -180.0, 0.0), (96.146061, 130.236578, 0.883663, 0.0, -180.0)]\nHIDDEN_SEGMENTS = _segments([[(95.2624, 99.8213), (95.2624, 101.5044), (97.0297, 101.5044)], [(97.0297, 99.8213), (97.0297, 101.5044)], [(97.0297, 100.6629), (172.6881, 100.6629)], [(172.6881, 99.8213), (172.6881, 100.6629)], [(191.7376, 122.2371), (191.7376, 121.3534)], [(191.7376, 122.2371), (191.7376, 130.2366)], [(192.5792, 129.5013), (193.4208, 129.5013)], [(192.5792, 129.5013), (192.5792, 123.9203)], [(193.4208, 123.9203), (192.5792, 123.9203)], [(191.7376, 130.2366), (191.7376, 131.1202)], [(191.7376, 121.3534), (193.4208, 121.3534)], [(191.7376, 131.1202), (193.4208, 131.1202)]])\nDIMENSIONS = [('horizontal', '100', (174.3713, 134.1788), (93.5792, 134.1788), (133.9752, 123.1788)), ('vertical', '18.9474', (174.3713, 118.8708), (174.3713, 134.1788), (163.3713, 126.5248)), ('horizontal', '2.1875', (95.2624, 122.2371), (97.0297, 122.2371), (96.146, 133.2371)), ('vertical', '9.9013', (97.0297, 122.2371), (97.0297, 130.2366), (86.0297, 126.2369)), ('horizontal', '2.0833', (93.5792, 118.8708), (95.2624, 118.8708), (94.4208, 129.8708)), ('vertical', '4.1667', (95.2624, 118.8708), (95.2624, 122.2371), (84.2624, 120.5539)), ('radius', 'R1.0938', (96.1461, 122.2371), 0.8837, 45), ('horizontal', '6.25', (188.3713, 118.8708), (193.4208, 118.8708), (190.896, 129.8708)), ('horizontal', '2.0833', (193.4208, 122.2371), (191.7376, 122.2371), (192.5792, 111.2371))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0028_00288910_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0029_00293638","images":["images/0029_00293638.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 30.38 mm, featuring a circular hole of diameter 10.34 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a circular plate with diameter 30.38 mm, featuring a circular hole of diameter 10.34 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a circular plate with diameter 24.82 mm, featuring a circular hole of diameter 9.83 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a polygonal plate with 4 straight edges, featuring a circular hole of diameter 10.08 mm. It is extruded to a thickness of 4.09 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 51.71 mm, featuring a circular hole of diameter 10.77 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 4.09 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4435514456349072\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(133.124739, 117.923309), (129.205748, 86.897962)], [(115.569219, 85.172991), (111.09634, 120.583284)], [(111.09634, 123.307153), (115.301611, 167.462498)], [(125.010418, 173.148905), (151.707425, 172.259005)], [(153.674709, 161.154592), (135.276648, 160.628933)], [(130.02006, 154.321027), (132.725251, 127.719982)], [(111.09634, 63.527043), (115.301611, 63.527043), (115.779483, 63.527043), (125.010418, 63.527043), (151.707425, 63.527043)], [(158.424754, 63.527043), (151.707425, 63.527043)], [(111.09634, 65.342956), (115.301611, 65.342956), (115.779483, 65.342956), (125.010418, 65.342956), (151.707425, 65.342956), (158.424754, 65.342956)], [(111.09634, 63.527043), (111.09634, 65.342956)], [(115.301611, 63.527043), (115.301611, 65.342956)], [(125.010418, 65.342956), (125.010418, 63.527043)], [(151.707425, 65.342956), (151.707425, 63.527043)], [(158.424754, 65.342956), (158.424754, 63.527043)], [(115.779483, 65.342956), (115.779483, 63.527043)], [(172.424754, 85.172991), (172.424754, 79.342956)], [(174.240666, 79.342956), (174.240666, 85.172991), (174.240666, 120.583284)], [(174.240666, 123.307153), (174.240666, 120.583284)], [(174.240666, 123.307153), (174.240666, 167.462498), (174.240666, 173.627043)], [(172.424754, 85.172991), (172.424754, 120.583284), (172.424754, 123.307153), (172.424754, 167.462498), (172.424754, 173.627043)], [(174.240666, 85.172991), (172.424754, 85.172991)], [(174.240666, 120.583284), (172.424754, 120.583284)], [(174.240666, 123.307153), (172.424754, 123.307153)], [(174.240666, 167.462498), (172.424754, 167.462498)], [(172.424754, 79.342956), (174.240666, 79.342956)], [(172.424754, 173.627043), (174.240666, 173.627043)]])\nVISIBLE_CIRCLES = [(120.042098, 95.982449, 2.23644), (122.517474, 86.080947, 2.293784), (122.565261, 122.399197, 2.389359), (152.919672, 166.889052, 2.179095), (122.517474, 166.889052, 2.293784), (122.517474, 86.080947, 6.737991), (122.517474, 166.889052, 6.737991), (152.919672, 166.889052, 5.505082), (122.565261, 122.399197, 11.468921)]\nVISIBLE_ARCS = [(122.278538, 86.000506, 6.760158, 102.496963, -172.96875), (122.278538, 121.962477, 11.26693, -172.96875, -54.812008), (122.565261, 122.399197, 11.468921, 167.258023, -57.240634), (122.135176, 122.219922, 11.092249, 165.864682, 174.375), (121.830635, 166.67552, 6.576282, 173.126983, -82.686575), (153.471417, 166.67401, 5.523161, -116.116874, -87.890625), (135.578227, 155.033419, 5.603635, 93.085054, -172.696196)]\nHIDDEN_SEGMENTS = [(120.8157, 65.343, 120.8157, 63.527), (129.2057, 65.343, 129.2057, 63.527), (133.1247, 65.343, 133.1247, 63.527), (132.7253, 65.343, 132.7253, 63.527), (128.7712, 65.343, 128.7712, 63.527), (122.2785, 63.527, 122.2785, 65.343), (130.0201, 63.527, 130.0201, 65.343), (135.2766, 63.527, 135.2766, 65.343), (153.6747, 63.527, 153.6747, 65.343), (151.0401, 65.343, 151.0401, 63.527), (122.6678, 65.343, 122.6678, 63.527), (155.0988, 63.527, 155.0988, 65.343), (129.2555, 65.343, 129.2555, 63.527), (134.0342, 65.343, 134.0342, 63.527), (117.8057, 65.343, 117.8057, 63.527), (120.2237, 65.343, 120.2237, 63.527), (120.1759, 65.343, 120.1759, 63.527), (129.9746, 65.343, 129.9746, 63.527), (150.7406, 65.343, 150.7406, 63.527), (172.4248, 92.6005, 174.2407, 92.6005), (172.4248, 86.898, 174.2407, 86.898), (172.4248, 117.9233, 174.2407, 117.9233), (172.4248, 127.72, 174.2407, 127.72), (172.4248, 112.7544, 174.2407, 112.7544), (172.4248, 124.9288, 174.2407, 124.9288), (174.2407, 154.321, 172.4248, 154.321), (174.2407, 160.6289, 172.4248, 160.6289), (174.2407, 161.1546, 172.4248, 161.1546), (172.4248, 161.7148, 174.2407, 161.7148), (172.4248, 172.259, 174.2407, 172.259), (172.4248, 160.1527, 174.2407, 160.1527), (172.4248, 110.9303, 174.2407, 110.9303), (172.4248, 110.6955, 174.2407, 110.6955), (172.4248, 93.746, 174.2407, 93.746), (172.4248, 98.2189, 174.2407, 98.2189), (172.4248, 83.7872, 174.2407, 83.7872), (172.4248, 88.3747, 174.2407, 88.3747), (172.4248, 120.0098, 174.2407, 120.0098), (172.4248, 124.7886, 174.2407, 124.7886), (172.4248, 161.1508, 174.2407, 161.1508), (172.4248, 160.0992, 174.2407, 160.0992), (172.4248, 161.384, 174.2407, 161.384), (172.4248, 172.3941, 174.2407, 172.3941), (172.4248, 160.1511, 174.2407, 160.1511), (172.4248, 164.71, 174.2407, 164.71), (172.4248, 169.0681, 174.2407, 169.0681), (172.4248, 164.5953, 174.2407, 164.5953), (172.4248, 169.1828, 174.2407, 169.1828)]\nDIMENSIONS = [('diameter', '%%c30.382', (122.5175, 86.0809), 6.738, 45), ('diameter', '%%c10.3428', (122.5175, 86.0809), 2.2938, 135), ('diameter', '%%c30.382', (122.5175, 166.8891), 6.738, 45), ('diameter', '%%c10.3428', (122.5175, 166.8891), 2.2938, 135), ('diameter', '%%c24.8227', (152.9197, 166.8891), 5.5051, 45), ('diameter', '%%c9.8257', (152.9197, 166.8891), 2.1791, 135), ('horizontal', '50.4212', (111.0963, 120.5833), (133.4607, 120.5833), (122.2785, 131.5833)), ('vertical', '79.8336', (133.4607, 120.5833), (133.4607, 85.173), (144.4607, 102.8781)), ('aligned', '80.4679', (115.5692, 85.173), (111.0963, 120.5833), (102.4195, 101.4996)), ('diameter', '%%c10.0842', (120.0421, 95.9824), 2.2364, 45), ('horizontal', '20.1685', (111.0963, 95.9824), (120.0421, 95.9824), (115.5692, 106.9824)), ('vertical', '55.4634', (120.0421, 120.5833), (120.0421, 95.9824), (131.0421, 108.2829)), ('radius', 'R25.4016', (122.2785, 121.9625), 11.2669, 45), ('radius', 'R15.241', (122.2785, 86.0005), 6.7602, 225), ('diameter', '%%c51.7141', (122.5653, 122.3992), 11.4689, 135), ('diameter', '%%c10.7738', (122.5653, 122.3992), 2.3894, 225), ('horizontal', '95.9942', (111.0963, 173.2447), (153.6747, 173.2447), (132.3855, 184.2447)), ('vertical', '112.586', (153.6747, 173.2447), (153.6747, 123.3072), (164.6747, 148.2759)), ('aligned', '41.4959', (153.6747, 161.1546), (135.2767, 160.6289), (144.7898, 149.8963)), ('aligned', '100', (111.0963, 123.3072), (115.3016, 167.4625), (102.2485, 146.4277)), ('radius', 'R14.8264', (121.8306, 166.6755), 6.5763, 225), ('radius', 'R12.4521', (153.4714, 166.674), 5.5231, 45), ('radius', 'R12.6336', (135.5782, 155.0334), 5.6037, 45), ('radius', 'R25.0078', (122.1352, 122.2199), 11.0922, 315), ('horizontal', '4.094', (174.2407, 86.0809), (172.4248, 86.0809), (173.3327, 75.0809)), ('horizontal', '4.094', (174.2407, 166.8891), (172.4248, 166.8891), (173.3327, 145.8891)), ('horizontal', '4.094', (174.2407, 120.5833), (172.4248, 120.5833), (173.3327, 109.5833)), ('horizontal', '4.094', (174.2407, 167.4625), (172.4248, 167.4625), (173.3327, 156.4625))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0029_00293638_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0033_00335132","images":["images/0033_00335132.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 5 straight edges, featuring 2 circular holes (diameters 8.33, 133.32 mm) and 3 polygonal cutouts. It is extruded to a thickness of 4.12 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 8.33 mm. It is extruded to a thickness of 4.12 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5510781441386201\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(129.636103, 125.889365), (129.636103, 104.460615)], [(106.676728, 126.654678), (128.870791, 126.654678)], [(129.636103, 139.304372), (129.636103, 136.60374)], [(129.636103, 149.614053), (129.636103, 139.304372)], [(129.636103, 158.03249), (129.636103, 149.614053)], [(106.676728, 135.838428), (97.492978, 131.246553)], [(115.860478, 135.838428), (106.676728, 135.838428)], [(119.716652, 135.838428), (115.860478, 135.838428)], [(128.870791, 135.838428), (119.716652, 135.838428)], [(138.054541, 140.466869), (138.054541, 158.03249), (129.636103, 149.614053), (115.860478, 135.838428), (106.676728, 126.654678)], [(138.054541, 136.60374), (138.054541, 140.466869)], [(138.994618, 135.838428), (138.819853, 135.838428)], [(161.013916, 135.838428), (138.994618, 135.838428)], [(138.819853, 126.654678), (161.013916, 126.654678)], [(138.054541, 125.889365), (138.054541, 136.60374)], [(138.054541, 104.460615), (138.054541, 125.889365)], [(170.962978, 75.96751), (170.962978, 80.511553)], [(97.492978, 75.96751), (170.962978, 75.96751)], [(97.492978, 80.511553), (170.962978, 80.511553)], [(97.492978, 75.96751), (97.492978, 80.511553)], [(189.507022, 94.511553), (189.507022, 131.246553), (189.507022, 167.981553)], [(184.962979, 94.511553), (184.962979, 131.246553), (184.962979, 167.981553)], [(189.507022, 131.246553), (184.962979, 131.246553)], [(184.962979, 94.511553), (189.507022, 94.511553)], [(184.962979, 167.981553), (189.507022, 167.981553)]])\nVISIBLE_CIRCLES = [(134.227978, 131.246553, 36.735), (134.227978, 131.246553, 2.295937)]\nVISIBLE_ARCS = [(134.227978, 131.246553, 36.735, 0.0, 180.0), (133.91299, 131.85755, 27.728754, -169.185228, -98.872728), (123.024948, 120.043523, 8.825035, 41.484375, 48.515625), (123.024948, 142.449583, 8.825035, -48.515625, -41.484375), (132.581095, 121.819656, 36.332387, 94.649321, 164.961821), (133.869238, 131.246553, 2.295937, -85.519201, 85.519201), (140.365284, 92.670114, 47.852579, 115.563116, 134.749384), (140.365284, 92.670114, 47.852579, 102.956616, 115.563116), (140.365284, 92.670114, 47.852579, 92.76782, 102.956616), (144.665696, 142.449583, 8.825035, -138.515625, -131.484375), (140.365284, 92.670114, 47.852579, 64.436884, 91.686238), (140.365284, 92.670114, 47.852579, 91.686238, 92.76782), (133.777655, 131.85755, 27.728754, -81.127272, -10.814772), (-116.931255, 136.115085, 255.926022, -2.118444, -0.061937), (-116.931255, 136.115085, 255.926022, -0.061937, 0.982168), (-116.931255, 136.115085, 255.926022, 0.982168, 4.912806)]\nHIDDEN_SEGMENTS = [(129.6361, 75.9675, 129.6361, 80.5116), (128.8708, 75.9675, 128.8708, 80.5116), (106.6767, 75.9675, 106.6767, 80.5116), (134.0486, 80.5116, 134.0486, 75.9675), (161.0139, 75.9675, 161.0139, 80.5116), (138.8199, 75.9675, 138.8199, 80.5116), (138.0545, 80.5116, 138.0545, 75.9675), (136.5239, 80.5116, 136.5239, 75.9675), (138.9948, 80.5116, 138.9948, 75.9675), (136.1652, 75.9675, 136.1652, 80.5116), (189.507, 104.4606, 184.963, 104.4606), (189.507, 125.8894, 184.963, 125.8894), (189.507, 126.6547, 184.963, 126.6547), (189.507, 136.6037, 184.963, 136.6037), (184.963, 135.8384, 189.507, 135.8384), (189.507, 158.0325, 184.963, 158.0325), (184.963, 128.9576, 189.507, 128.9576), (189.507, 133.5355, 184.963, 133.5355), (187.235, 136.6037, 187.235, 158.0325), (184.963, 128.9506, 189.507, 128.9506), (184.963, 133.5425, 189.507, 133.5425), (184.963, 140.5227, 189.507, 140.5227)]\nDIMENSIONS = [('horizontal', '40.2739', (161.0139, 135.8384), (138.8198, 135.8384), (149.9169, 124.8384)), ('vertical', '38.8851', (138.0546, 136.6037), (138.0546, 158.0325), (127.0546, 147.3181)), ('aligned', '80.5238', (138.0546, 158.0325), (106.6767, 126.6547), (130.1438, 134.5654)), ('diameter', '%%c133.321', (134.228, 131.2466), 36.735, 45), ('horizontal', '49.9952', (106.6767, 131.2466), (134.228, 131.2466), (120.4524, 142.2466)), ('vertical', '48.6064', (134.228, 158.0325), (134.228, 131.2466), (145.228, 144.6395)), ('diameter', '%%c8.3325', (134.228, 131.2466), 2.2959, 135), ('horizontal', '49.9952', (106.6767, 131.2466), (134.228, 131.2466), (120.4524, 142.2466)), ('vertical', '48.6064', (134.228, 158.0325), (134.228, 131.2466), (145.228, 144.6395)), ('horizontal', '58.3277', (97.493, 158.0325), (129.6361, 158.0325), (113.5645, 169.0325)), ('vertical', '48.6064', (97.493, 158.0325), (97.493, 131.2466), (108.493, 144.6395)), ('horizontal', '16.6651', (106.6767, 158.0325), (97.493, 158.0325), (102.0848, 147.0325)), ('horizontal', '41.6626', (106.6767, 126.6547), (129.6361, 126.6547), (118.1564, 137.6547)), ('vertical', '40.2739', (106.6767, 126.6547), (106.6767, 104.4606), (117.6767, 115.5577)), ('vertical', '56.9389', (106.6767, 158.0325), (106.6767, 126.6547), (117.6767, 142.3436)), ('horizontal', '41.6626', (138.0546, 158.0325), (161.0139, 158.0325), (149.5342, 169.0325)), ('vertical', '97.2128', (138.0546, 158.0325), (138.0546, 104.4606), (149.0546, 131.2466)), ('horizontal', '56.939', (106.6767, 158.0325), (138.0546, 158.0325), (122.3656, 169.0325)), ('radius', 'R65.9296', (132.5811, 121.8196), 36.3324, 45), ('radius', 'R16.0141', (123.025, 142.4496), 8.825, 45), ('radius', 'R50.3173', (133.913, 131.8575), 27.7288, 225), ('radius', 'R86.8345', (140.3653, 92.6701), 47.8526, 45), ('radius', 'R16.0141', (144.6657, 142.4496), 8.825, 45), ('radius', 'R464.41', (-116.9313, 136.1151), 255.926, 45), ('diameter', '%%c8.3325', (133.8692, 131.2466), 2.2959, 315), ('horizontal', '8.2457', (189.507, 126.6547), (184.963, 126.6547), (187.235, 115.6547))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0033_00335132_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0037_00373230","images":["images/0037_00373230.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectilinear stepped plate with 8 edges within a 42.11 x 100 mm bounding box. It is extruded to a thickness of 4.17 mm. A union feature: The part is a rectilinear stepped plate with 8 edges within a 42.11 x 100 mm bounding box. It is extruded to a thickness of 16.67 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7648931506849305\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(155.790068, 168.618767), (155.790068, 142.853945)], [(123.584041, 168.618767), (155.790068, 168.618767)], [(155.790068, 142.853945), (123.584041, 142.853945)], [(123.584041, 117.894274), (155.790068, 117.894274), (155.790068, 92.129452), (123.584041, 92.129452)], [(155.790068, 78.129452), (155.790068, 65.381233)], [(123.584041, 78.129452), (155.790068, 78.129452)], [(123.584041, 65.381233), (155.790068, 65.381233)], [(85.339383, 65.381233), (123.584041, 65.381233)], [(85.339383, 78.129452), (123.584041, 78.129452)], [(85.339383, 78.129452), (85.339383, 65.381233)], [(123.584041, 78.129452), (123.584041, 65.381233)], [(169.790069, 168.618767), (182.538288, 168.618767)], [(182.538288, 92.129452), (182.538288, 168.618767)], [(169.790069, 92.129452), (169.790069, 168.618767)], [(169.790069, 92.129452), (182.538288, 92.129452)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(123.584041, 130.37411, 12.479836, 90.0, -90.0), (123.584041, 130.37411, 38.244658, 90.0, -90.0)]\nHIDDEN_SEGMENTS = [(111.1042, 78.1295, 111.1042, 65.3812), (182.5383, 142.8539, 169.7901, 142.8539), (182.5383, 117.8943, 169.7901, 117.8943)]\nDIMENSIONS = [('horizontal', '42.1053', (155.7901, 142.854), (123.584, 142.854), (139.6871, 131.854)), ('vertical', '32.6316', (123.584, 142.854), (123.584, 117.8943), (134.584, 130.3741)), ('vertical', '33.6842', (155.7901, 168.6188), (155.7901, 142.854), (166.7901, 155.7364)), ('vertical', '100', (123.584, 92.1295), (123.584, 168.6188), (112.584, 130.3741)), ('radius', 'R16.3158', (123.584, 130.3741), 12.4798, 45), ('radius', 'R50', (123.584, 130.3741), 38.2447, 135), ('horizontal', '42.1053', (123.584, 168.6188), (155.7901, 168.6188), (139.6871, 179.6188)), ('vertical', '100', (155.7901, 168.6188), (155.7901, 92.1295), (166.7901, 130.3741)), ('radius', 'R16.3158', (123.584, 130.3741), 12.4798, 225), ('radius', 'R50', (123.584, 130.3741), 38.2447, 315), ('horizontal', '16.6667', (182.5383, 168.6188), (169.79, 168.6188), (176.1642, 157.6188))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0037_00373230_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0041_00419903","images":["images/0041_00419903.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 50.53 mm tall. It is extruded to a thickness of 5.98 mm. A cut feature: The part is a polygonal plate with 12 straight edges. It is extruded to a thickness of -3.8 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.386510769230798\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(201.681077, 93.116821), (201.681077, 163.172102), (192.924167, 163.172102), (71.78691, 163.172102), (63.03, 163.172102), (63.03, 93.116821), (201.681077, 93.116821)], [(71.78691, 123.766007), (71.78691, 163.172102)], [(192.924167, 163.172102), (192.924167, 123.766007)], [(118.490431, 101.873731), (84.922275, 107.711671)], [(146.220646, 101.873731), (118.490431, 101.873731)], [(179.788802, 107.711671), (146.220646, 101.873731)], [(201.681077, 79.116821), (201.681077, 76.102667)], [(201.681077, 79.116821), (63.03, 79.116821)], [(201.681077, 76.102667), (192.924167, 76.102667)], [(192.924167, 70.827898), (192.924167, 76.102667)], [(192.924167, 70.827898), (71.78691, 70.827898), (71.78691, 76.102667), (63.03, 76.102667)], [(63.03, 79.116821), (63.03, 76.102667)], [(71.785384, 70.827898), (71.78691, 70.827898)], [(192.924167, 70.827898), (192.925693, 70.827898)], [(192.925693, 76.102667), (192.925693, 70.827898)], [(71.785384, 76.102667), (71.785384, 70.827898)], [(215.681077, 163.172102), (215.681077, 93.116821)], [(223.97, 163.172102), (218.695231, 163.172102)], [(215.681077, 163.172102), (218.695231, 163.172102), (218.695231, 93.116821)], [(215.681077, 93.116821), (218.695231, 93.116821)], [(223.97, 123.766007), (218.695231, 123.766007)], [(223.97, 123.766007), (223.97, 163.172102)], [(223.97, 107.711671), (223.97, 123.766007)], [(223.97, 101.873731), (223.97, 107.711671)], [(223.97, 101.873731), (218.695231, 101.873731)], [(223.97, 107.711671), (218.695231, 107.711671)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(87.894551, 123.544259, 16.109167, 179.211282, -100.632468), (176.816526, 123.544259, 16.109167, -79.367532, 0.788718)]\nHIDDEN_SEGMENTS = [(179.7888, 70.8279, 179.7888, 76.1027), (146.2206, 70.8279, 146.2206, 76.1027), (118.4904, 70.8279, 118.4904, 76.1027), (84.9223, 70.8279, 84.9223, 76.1027)]\nDIMENSIONS = [('horizontal', '100', (201.6811, 163.1721), (63.03, 163.1721), (132.3555, 152.1721)), ('vertical', '50.5263', (201.6811, 93.1168), (201.6811, 163.1721), (190.6811, 128.1445)), ('horizontal', '100', (63.03, 93.1168), (201.6811, 93.1168), (132.3555, 104.1168)), ('vertical', '50.5263', (201.6811, 93.1168), (201.6811, 163.1721), (190.6811, 128.1445)), ('vertical', '0', (63.03, 93.1168), (63.03, 93.1168), (63.03, 93.1168)), ('aligned', '24.5739', (179.7887, 107.7116), (146.2206, 101.8737), (164.8894, 93.9554)), ('aligned', '24.5739', (118.4904, 101.8737), (84.9223, 107.7116), (99.8216, 93.9554)), ('radius', 'R11.6185', (176.8165, 123.5442), 16.1092, 45)]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0041_00419903_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0042_00420331","images":["images/0042_00420331.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 65.49 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 13.41 mm wide and 84.96 mm tall. It is extruded to a thickness of 65.49 mm. A union feature: The part is a rectangular plate 100 mm wide and 84.21 mm tall. It is extruded to a thickness of 65.49 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.454064040492989\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(98.554881, 119.579908), (98.897491, 152.127861), (98.897491, 119.579908)], [(92.870092, 158.15526), (92.870092, 119.579908), (98.554881, 119.579908)], [(98.897491, 119.579908), (150.39474, 119.579908), (150.39474, 158.15526), (144.303895, 158.15526), (144.303895, 157.816879)], [(98.942359, 156.390257), (98.960937, 158.15526), (92.870092, 158.15526)], [(150.39474, 105.579908), (144.303895, 105.579908), (98.960937, 105.579908)], [(92.870092, 105.579908), (98.960937, 105.579908)], [(150.39474, 75.84474), (144.303895, 75.84474), (98.960937, 75.84474), (92.870092, 75.84474)], [(92.870092, 105.579908), (92.870092, 75.84474)], [(98.960937, 105.579908), (98.960937, 75.84474)], [(144.303895, 105.579908), (144.303895, 75.84474)], [(150.39474, 105.579908), (150.39474, 75.84474)], [(164.39474, 158.15526), (164.39474, 119.579908)], [(194.129908, 158.15526), (194.129908, 119.579908)], [(164.39474, 119.579908), (194.129908, 119.579908)], [(164.39474, 158.15526), (194.129908, 158.15526)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(121.600693, 157.816879, 22.703202, -176.397278, -0.0)]\nHIDDEN_SEGMENTS = [(194.1299, 152.1279, 164.3947, 152.1279), (194.1299, 156.3903, 164.3947, 156.3903), (194.1299, 135.1137, 164.3947, 135.1137)]\nDIMENSIONS = [('horizontal', '12.5198', (92.8701, 119.5799), (98.5549, 119.5799), (95.7125, 130.5799)), ('horizontal', '13.4141', (98.9609, 158.1553), (92.8701, 158.1553), (95.9155, 147.1553)), ('vertical', '84.9558', (92.8701, 158.1553), (92.8701, 119.5799), (103.8701, 138.8676)), ('vertical', '84.9605', (98.5549, 119.5799), (98.9609, 158.1553), (87.7585, 138.9834)), ('horizontal', '13.4141', (144.3039, 119.5799), (150.3948, 119.5799), (147.3493, 130.5799)), ('vertical', '84.9558', (150.3948, 119.5799), (150.3948, 158.1553), (139.3948, 138.8676)), ('horizontal', '113.274', (92.8701, 119.5799), (144.3039, 119.5799), (118.587, 130.5799)), ('vertical', '0', (144.3039, 119.5799), (144.3039, 119.5799), (144.3039, 119.5799)), ('horizontal', '100', (98.8975, 119.5799), (144.3039, 119.5799), (121.6007, 130.5799)), ('vertical', '84.2106', (144.3039, 119.5799), (144.3039, 157.8169), (133.3039, 138.6984)), ('horizontal', '13.2743', (92.8701, 119.5799), (98.8975, 119.5799), (95.8838, 130.5799)), ('vertical', '0', (98.8975, 119.5799), (98.8975, 119.5799), (98.8975, 119.5799)), ('radius', 'R50', (121.6007, 157.8169), 22.7032, 45), ('horizontal', '65.4867', (164.3947, 119.5799), (194.1299, 119.5799), (179.2623, 130.5799)), ('horizontal', '65.4867', (164.3947, 119.5799), (194.1299, 119.5799), (179.2623, 130.5799))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0042_00420331_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0051_00512842","images":["images/0051_00512842.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 30.38 mm, featuring a circular hole of diameter 10.34 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a circular plate with diameter 24.82 mm, featuring a circular hole of diameter 9.83 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a circular plate with diameter 30.38 mm, featuring a circular hole of diameter 10.34 mm. It is extruded to a thickness of 4.09 mm. A union feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 4.09 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges, featuring a circular hole of diameter 10.08 mm. It is extruded to a thickness of 4.09 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 51.71 mm, featuring a circular hole of diameter 10.77 mm. It is extruded to a thickness of 4.09 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4435514456349073\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(133.124739, 135.046691), (129.205748, 166.072037)], [(115.569219, 167.797009), (111.09634, 132.386715)], [(111.09634, 129.662847), (115.301611, 85.507501)], [(125.010418, 79.821095), (151.707425, 80.710995)], [(153.674709, 91.815407), (135.276648, 92.341066)], [(130.02006, 98.648973), (132.725251, 125.250017)], [(115.779483, 63.527043), (129.255465, 63.527043)], [(129.255465, 65.342956), (115.779483, 65.342956)], [(133.124739, 65.342956), (129.255465, 65.342956)], [(115.779483, 65.342956), (115.569219, 65.342956), (111.09634, 65.342956)], [(153.674709, 65.342956), (158.424754, 65.342956)], [(153.674709, 65.342956), (135.276648, 65.342956), (134.034182, 65.342956)], [(133.124739, 65.342956), (134.034182, 65.342956)], [(133.124739, 63.527043), (133.124739, 65.342956)], [(133.124739, 63.527043), (129.255465, 63.527043)], [(115.779483, 63.527043), (115.569219, 63.527043), (111.09634, 63.527043)], [(158.424754, 63.527043), (153.674709, 63.527043), (135.276648, 63.527043), (134.034182, 63.527043), (133.124739, 63.527043)], [(115.569219, 65.342956), (115.569219, 63.527043)], [(111.09634, 65.342956), (111.09634, 63.527043)], [(135.276648, 65.342956), (135.276648, 63.527043)], [(153.674709, 65.342956), (153.674709, 63.527043)], [(129.255465, 63.527043), (129.255465, 65.342956)], [(115.779483, 63.527043), (115.779483, 65.342956)], [(134.034182, 63.527043), (134.034182, 65.342956)], [(158.424754, 63.527043), (158.424754, 65.342956)], [(174.240666, 167.797009), (174.240666, 173.627043)], [(172.424754, 173.627043), (172.424754, 167.797009), (172.424754, 132.386715), (172.424754, 129.662847), (172.424754, 85.507501), (172.424754, 79.342956)], [(174.240666, 167.797009), (174.240666, 132.386715), (174.240666, 129.662847), (174.240666, 85.507501), (174.240666, 79.342956)], [(172.424754, 167.797009), (174.240666, 167.797009)], [(172.424754, 132.386715), (174.240666, 132.386715)], [(172.424754, 129.662847), (174.240666, 129.662847)], [(172.424754, 85.507501), (174.240666, 85.507501)], [(174.240666, 173.627043), (172.424754, 173.627043)], [(174.240666, 79.342956), (172.424754, 79.342956)]])\nVISIBLE_CIRCLES = [(120.042098, 156.987551, 2.23644), (122.517474, 166.889052, 2.293784), (122.565261, 130.570803, 2.389359), (152.919672, 86.080947, 2.179095), (122.517474, 86.080947, 2.293784), (122.517474, 86.080947, 6.737991), (152.919672, 86.080947, 5.505082), (122.517474, 166.889052, 6.737991), (122.565261, 130.570803, 11.468921)]\nVISIBLE_ARCS = [(122.278538, 166.969493, 6.760158, 172.96875, -102.496963), (122.278538, 131.007523, 11.26693, 54.812008, 172.96875), (122.135176, 130.750077, 11.092249, -174.375, -165.864682), (121.830635, 86.29448, 6.576282, 82.686575, -173.126983), (153.471417, 86.295989, 5.523161, 87.890625, 116.116874), (135.578227, 97.93658, 5.603635, 172.696196, -93.085054), (122.565261, 130.570803, 11.468921, -27.641047, 22.970823)]\nHIDDEN_SEGMENTS = [(120.8157, 63.527, 120.8157, 65.343), (122.2785, 65.343, 122.2785, 63.527), (124.8113, 65.343, 124.8113, 63.527), (124.9546, 65.343, 124.9546, 63.527), (130.0201, 65.343, 130.0201, 63.527), (151.0401, 63.527, 151.0401, 65.343), (151.7074, 63.527, 151.7074, 65.343), (125.0104, 63.527, 125.0104, 65.343), (122.6678, 63.527, 122.6678, 65.343), (155.0988, 65.343, 155.0988, 63.527), (117.8057, 63.527, 117.8057, 65.343), (120.2237, 63.527, 120.2237, 65.343), (120.1759, 63.527, 120.1759, 65.343), (129.9746, 63.527, 129.9746, 65.343), (150.7406, 63.527, 150.7406, 65.343), (174.2407, 160.3695, 172.4248, 160.3695), (174.2407, 166.072, 172.4248, 166.072), (174.2407, 135.0467, 172.4248, 135.0467), (174.2407, 140.2156, 172.4248, 140.2156), (174.2407, 125.25, 172.4248, 125.25), (174.2407, 128.0412, 172.4248, 128.0412), (172.4248, 98.649, 174.2407, 98.649), (172.4248, 92.3411, 174.2407, 92.3411), (172.4248, 91.8154, 174.2407, 91.8154), (174.2407, 91.2552, 172.4248, 91.2552), (174.2407, 80.711, 172.4248, 80.711), (174.2407, 92.8173, 172.4248, 92.8173), (174.2407, 142.2745, 172.4248, 142.2745), (174.2407, 159.224, 172.4248, 159.224), (174.2407, 154.7511, 172.4248, 154.7511), (174.2407, 169.1828, 172.4248, 169.1828), (174.2407, 164.5953, 172.4248, 164.5953), (174.2407, 142.0397, 172.4248, 142.0397), (174.2407, 132.9602, 172.4248, 132.9602), (174.2407, 128.1814, 172.4248, 128.1814), (174.2407, 91.8192, 172.4248, 91.8192), (174.2407, 91.586, 172.4248, 91.586), (174.2407, 80.5759, 172.4248, 80.5759), (174.2407, 92.8189, 172.4248, 92.8189), (174.2407, 92.8708, 172.4248, 92.8708), (174.2407, 88.3747, 172.4248, 88.3747), (174.2407, 83.7872, 172.4248, 83.7872), (174.2407, 88.26, 172.4248, 88.26), (174.2407, 83.9019, 172.4248, 83.9019)]\nDIMENSIONS = [('diameter', '%%c30.382', (122.5175, 86.0809), 6.738, 45), ('diameter', '%%c10.3428', (122.5175, 86.0809), 2.2938, 135), ('diameter', '%%c24.8227', (152.9197, 86.0809), 5.5051, 45), ('diameter', '%%c9.8257', (152.9197, 86.0809), 2.1791, 135), ('diameter', '%%c30.382', (122.5175, 166.8891), 6.738, 45), ('diameter', '%%c10.3428', (122.5175, 166.8891), 2.2938, 135), ('horizontal', '95.9942', (111.0963, 79.7253), (153.6747, 79.7253), (132.3855, 90.7253)), ('vertical', '112.586', (153.6747, 79.7253), (153.6747, 129.6628), (142.6747, 104.6941)), ('aligned', '41.4959', (153.6747, 91.8154), (135.2767, 92.3411), (144.1615, 81.0827)), ('aligned', '100', (111.0963, 129.6628), (115.3016, 85.5075), (124.1494, 108.6281)), ('radius', 'R14.8264', (121.8306, 86.2945), 6.5763, 225), ('radius', 'R12.4521', (153.4714, 86.296), 5.5231, 45), ('radius', 'R12.6336', (135.5782, 97.9366), 5.6037, 45), ('radius', 'R25.0078', (122.1352, 130.7501), 11.0922, 45), ('horizontal', '50.4212', (111.0963, 132.3867), (133.4607, 132.3867), (122.2785, 143.3867)), ('vertical', '79.8336', (133.4607, 132.3867), (133.4607, 167.797), (122.4607, 150.0919)), ('aligned', '80.4679', (115.5692, 167.797), (111.0963, 132.3867), (124.2461, 148.7133)), ('diameter', '%%c10.0842', (120.0421, 156.9876), 2.2364, 45), ('horizontal', '20.1685', (111.0963, 156.9876), (120.0421, 156.9876), (115.5692, 167.9876)), ('vertical', '55.4634', (120.0421, 132.3867), (120.0421, 156.9876), (109.0421, 144.6871)), ('radius', 'R25.4016', (122.2785, 131.0075), 11.2669, 45), ('radius', 'R15.241', (122.2785, 166.9695), 6.7602, 225), ('diameter', '%%c51.7141', (122.5653, 130.5708), 11.4689, 135), ('diameter', '%%c10.7738', (122.5653, 130.5708), 2.3894, 225), ('horizontal', '4.094', (172.4248, 86.0809), (174.2407, 86.0809), (173.3327, 97.0809)), ('horizontal', '4.094', (172.4248, 86.0809), (174.2407, 86.0809), (173.3327, 107.0809)), ('horizontal', '4.094', (172.4248, 85.5075), (174.2407, 85.5075), (173.3327, 96.5075)), ('horizontal', '4.094', (172.4248, 132.3867), (174.2407, 132.3867), (173.3327, 143.3867))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0051_00512842_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0057_00570190","images":["images/0057_00570190.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 90.06 mm wide and 11.38 mm tall. It is extruded to a thickness of 7.78 mm. A union feature: The part is a polygonal plate with 8 straight edges, featuring a rectangular cutout 91.01 x 12.36 mm. It is extruded to a thickness of 106.74 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.688297894736867\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(130.3775, 157.214563), (130.3775, 164.988526)], [(131.086421, 164.988526), (68.443579, 164.988526)], [(68.443579, 157.214563), (130.3775, 157.214563)], [(68.443579, 164.988526), (68.443579, 156.481474)], [(65.350105, 151.067895), (134.179895, 151.067895)], [(136.5, 153.388), (136.5, 168.082)], [(134.179895, 170.402105), (65.350105, 170.402105)], [(63.03, 168.082), (63.03, 153.388)], [(131.086421, 156.481474), (131.086421, 164.988526)], [(68.443579, 156.481474), (131.086421, 156.481474)], [(136.5, 137.067895), (134.179895, 137.067895), (65.350105, 137.067895), (63.03, 137.067895)], [(136.5, 63.597895), (134.179895, 63.597895), (65.350105, 63.597895), (63.03, 63.597895)], [(63.03, 137.067895), (63.03, 63.597895)], [(136.5, 137.067895), (136.5, 63.597895)], [(65.350105, 137.067895), (65.350105, 63.597895)], [(134.179895, 137.067895), (134.179895, 63.597895)], [(150.5, 153.388), (150.5, 151.067895)], [(150.5, 170.402105), (150.5, 168.082), (150.5, 153.388)], [(223.97, 153.388), (223.97, 151.067895)], [(223.97, 170.402105), (223.97, 168.082), (223.97, 153.388)], [(150.5, 151.067895), (223.97, 151.067895)], [(150.5, 170.402105), (223.97, 170.402105)], [(150.5, 153.388), (223.97, 153.388)], [(150.5, 168.082), (223.97, 168.082)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(65.350105, 153.388, 2.320105, -180.0, -90.0), (134.179895, 153.388, 2.320105, -90.0, 0.0), (134.179895, 168.082, 2.320105, 0.0, 90.0), (65.350105, 168.082, 2.320105, 90.0, -180.0)]\nHIDDEN_SEGMENTS = _segments([[(130.3775, 137.0679), (130.3775, 131.7107)], [(131.0864, 137.0679), (131.0864, 63.5979)], [(68.4436, 131.7107), (130.3775, 131.7107)], [(68.4436, 137.0679), (68.4436, 63.5979)], [(150.5, 157.2146), (155.8572, 157.2146), (155.8572, 164.9885)], [(150.5, 164.9885), (223.97, 164.9885)], [(150.5, 156.4815), (223.97, 156.4815)]])\nDIMENSIONS = [('horizontal', '106.742', (63.03, 151.0679), (136.5, 151.0679), (99.765, 162.0679)), ('vertical', '28.0899', (136.5, 151.0679), (136.5, 170.4021), (125.5, 160.735)), ('horizontal', '7.7833', (68.3872, 157.2145), (63.03, 157.2145), (65.7086, 146.2145)), ('vertical', '8.9302', (63.03, 157.2145), (63.03, 151.0679), (74.03, 154.1412)), ('horizontal', '91.0112', (68.4436, 156.4815), (131.0864, 156.4815), (99.765, 167.4815)), ('vertical', '12.3596', (68.4436, 156.4815), (68.4436, 164.9885), (57.4436, 160.735)), ('horizontal', '7.8652', (63.03, 156.4815), (68.4436, 156.4815), (65.7368, 167.4815)), ('vertical', '7.8652', (68.4436, 151.0679), (68.4436, 156.4815), (57.4436, 153.7747)), ('radius', 'R3.3708', (65.3501, 153.388), 2.3201, 45), ('horizontal', '7.7832', (150.5, 157.2145), (155.8572, 157.2145), (153.1786, 168.2145)), ('horizontal', '106.742', (150.5, 153.388), (223.97, 153.388), (187.235, 164.388))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0057_00570190_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0059_00596039","images":["images/0059_00596039.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 12.2 mm. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 117.94 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.41729276906871465\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(127.462875, 116.380268), (127.462875, 111.289154), (85.733598, 111.289154)], [(127.462875, 116.380268), (85.733598, 116.380268)], [(106.663736, 111.289154), (106.663736, 62.075045)], [(118.528219, 62.075045), (106.663736, 62.075045), (86.016438, 62.075045)], [(85.733598, 111.289154), (85.733598, 116.380268)], [(118.528219, 62.075045), (118.528219, 111.289154)], [(86.016438, 62.075045), (86.016438, 111.289154)], [(146.55399, 172.175045), (146.55399, 132.926851)], [(141.462875, 172.175045), (141.462875, 130.445768)], [(146.55399, 132.926851), (146.55399, 130.380268)], [(146.55399, 171.674865), (195.768098, 171.674865)], [(146.55399, 130.380268), (195.768098, 130.380268)], [(195.768098, 171.674865), (195.768098, 130.380268)], [(146.55399, 172.175045), (141.462875, 172.175045)], [(146.55399, 130.445768), (141.462875, 130.445768)]])\nVISIBLE_CIRCLES = [(106.598236, 151.310407, 20.864638)]\nVISIBLE_ARCS = [(106.598236, 151.310407, 20.864638, -0.0, -118.22627), (94.630132, 151.027567, 23.898087, -59.765625, 59.765625), (106.663736, 151.027567, 20.647298, 90.0, -90.0)]\nHIDDEN_SEGMENTS = _segments([[(106.6637, 171.6749), (96.7302, 132.9269), (106.6637, 130.3803)]])\nDIMENSIONS = [('diameter', '%%c100', (106.5982, 151.3104), 20.8646, 45), ('radius', 'R57.2694', (94.6301, 151.0276), 23.8981, 45), ('radius', 'R49.4792', (106.6637, 151.0276), 20.6473, 135), ('horizontal', '12.2003', (141.4629, 151.3104), (146.554, 151.3104), (144.0084, 162.3104)), ('horizontal', '117.937', (146.554, 130.3803), (195.7681, 130.3803), (171.161, 141.3803))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0059_00596039_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0064_00649066","images":["images/0064_00649066.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of 13.04 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 10.43 mm. It is extruded to a thickness of -11.95 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.8189766036264652\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(123.6748, 88.3911), (123.6748, 170.28876)], [(125.43604, 172.05), (136.8841, 172.05)], [(138.64534, 170.28876), (138.64534, 88.3911)], [(136.8841, 86.62986), (125.43604, 86.62986)], [(123.6748, 61.95), (125.43604, 61.95)], [(123.6748, 72.62986), (125.43604, 72.62986)], [(123.6748, 61.95), (123.6748, 72.62986)], [(125.43604, 72.62986), (136.8841, 72.62986)], [(125.43604, 61.95), (136.8841, 61.95), (138.64534, 61.95)], [(136.8841, 72.62986), (138.64534, 72.62986)], [(138.64534, 61.95), (138.64534, 72.62986)], [(125.43604, 61.95), (125.43604, 72.62986)], [(136.8841, 61.95), (136.8841, 72.62986)], [(163.3252, 170.28876), (163.3252, 172.05), (152.64534, 172.05)], [(152.64534, 170.28876), (152.64534, 172.05)], [(152.64534, 88.3911), (152.64534, 170.28876)], [(163.3252, 88.3911), (163.3252, 170.28876)], [(163.3252, 86.62986), (163.3252, 88.3911)], [(152.64534, 86.62986), (152.64534, 88.3911)], [(163.3252, 86.62986), (152.64534, 86.62986)], [(163.3252, 170.28876), (152.64534, 170.28876)], [(163.3252, 88.3911), (152.64534, 88.3911)]])\nVISIBLE_CIRCLES = [(131.417698, 133.354246, 4.271944)]\nVISIBLE_ARCS = [(125.43604, 170.28876, 1.76124, 90.0, -180.0), (136.8841, 170.28876, 1.76124, -0.0, 90.0), (136.8841, 88.3911, 1.76124, -90.0, 0.0), (125.43604, 88.3911, 1.76124, -180.0, -90.0)]\nHIDDEN_SEGMENTS = _segments([[(127.1458, 61.95), (127.1458, 71.7399), (135.6896, 71.7399), (135.6896, 61.95)], [(153.5353, 129.0823), (153.5353, 137.6262)], [(153.5353, 129.0823), (163.3252, 129.0823)], [(153.5353, 137.6262), (163.3252, 137.6262)]])\nDIMENSIONS = [('horizontal', '13.9785', (125.436, 172.05), (136.8841, 172.05), (131.1601, 183.05)), ('vertical', '100', (138.6454, 170.2888), (138.6454, 88.3911), (149.6454, 129.34)), ('radius', 'R2.1505', (125.436, 170.2888), 1.7612, 45), ('diameter', '%%c10.4324', (131.4177, 133.3543), 4.2719, 45), ('horizontal', '9.4543', (123.6748, 172.05), (131.4177, 172.05), (127.5462, 183.05)), ('vertical', '47.2489', (131.4177, 172.05), (131.4177, 133.3543), (142.4177, 152.7021)), ('horizontal', '13.0405', (163.3252, 170.2888), (152.6453, 170.2888), (157.9853, 159.2888))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0064_00649066_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0078_00783518","images":["images/0078_00783518.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 34.74 mm wide and 100 mm tall, featuring a rectangular cutout 21.05 x 58.95 mm. It is extruded to a thickness of 17.02 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 17.02 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 17.02 mm. A union feature: The part is a rectangular plate 21.07 mm wide and 58.87 mm tall. It is extruded to a thickness of 53.9 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5276168536819597\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(116.864539, 117.468679), (116.813333, 117.468679)], [(127.921056, 117.468679), (128.090429, 117.468679)], [(112.92563, 170.230365), (112.92563, 117.468679)], [(131.635447, 117.468679), (131.253373, 117.468679), (131.253373, 168.942803)], [(131.635447, 170.230365), (128.090429, 170.230365)], [(116.864539, 170.230365), (112.92563, 170.230365)], [(116.813333, 159.122642), (116.813333, 159.004474)], [(127.921056, 159.122642), (116.813333, 159.122642)], [(127.921056, 128.021017), (127.921056, 159.122642)], [(127.408998, 128.021017), (127.921056, 128.021017)], [(127.408998, 159.004474), (116.293397, 159.004474), (116.293397, 127.946177), (127.408998, 127.946177), (127.408998, 159.004474)], [(128.090429, 94.113771), (131.635447, 94.113771)], [(128.090429, 94.113771), (116.864539, 94.113771)], [(112.92563, 94.113771), (116.864539, 94.113771)], [(131.635447, 85.133058), (128.090429, 85.133058), (116.864539, 85.133058), (112.92563, 85.133058)], [(112.92563, 94.113771), (112.92563, 85.133058)], [(116.864539, 94.113771), (116.864539, 85.133058)], [(128.090429, 94.113771), (128.090429, 85.133058)], [(131.635447, 94.113771), (131.635447, 85.133058)], [(127.408998, 85.133058), (127.408998, 65.674848), (116.293397, 65.674848)], [(116.293397, 85.133058), (116.293397, 65.674848)], [(145.635448, 170.230365), (145.635448, 117.468679), (145.635448, 108.113771)], [(145.635448, 175.774848), (145.635448, 170.230365)], [(154.61616, 170.230365), (154.61616, 117.468679), (154.61616, 108.113771)], [(154.61616, 175.774848), (154.61616, 170.230365)], [(145.635448, 170.230365), (154.61616, 170.230365)], [(154.61616, 159.004474), (174.07437, 159.004474), (174.07437, 127.946177)], [(154.61616, 127.946177), (174.07437, 127.946177)], [(154.61616, 108.113771), (145.635448, 108.113771)], [(154.61616, 175.774848), (145.635448, 175.774848)], [(145.635448, 117.468679), (154.61616, 117.468679)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(122.367195, 116.783676, 5.595946, 7.03125, 172.96875), (122.280539, 117.468679, 9.354909, -180.0, -0.0), (122.969848, 172.101347, 8.86528, -20.87206, -12.183657), (122.477484, 170.16148, 5.613368, 0.703125, 179.296875), (122.477484, 117.192933, 5.619714, 177.1875, 2.8125)]\nHIDDEN_SEGMENTS = [(154.6162, 168.9428, 145.6354, 168.9428), (154.6162, 122.3796, 145.6354, 122.3796), (154.6162, 111.5732, 145.6354, 111.5732)]\nDIMENSIONS = [('horizontal', '21.0526', (116.8134, 128.021), (127.9211, 128.021), (122.3672, 139.021)), ('vertical', '58.9474', (116.8134, 128.021), (116.8134, 159.1227), (105.8134, 143.5718)), ('horizontal', '7.3685', (112.9256, 128.021), (116.8134, 128.021), (114.8695, 139.021)), ('vertical', '20', (116.8134, 117.4687), (116.8134, 128.021), (105.8134, 122.7449)), ('radius', 'R10.6061', (122.3672, 116.7837), 5.596, 45), ('radius', 'R10.5295', (122.3672, 170.3667), 5.5555, 45), ('horizontal', '35.461', (112.9256, 170.2304), (131.6354, 170.2304), (122.2805, 181.2304)), ('vertical', '7.0922', (131.6354, 170.2304), (131.6354, 173.9723), (120.6354, 172.1014)), ('vertical', '0', (112.9256, 117.4687), (112.9256, 117.4687), (112.9256, 117.4687)), ('vertical', '100', (112.9256, 117.4687), (112.9256, 170.2304), (101.9256, 143.8495)), ('radius', 'R16.8025', (122.9698, 172.1014), 8.8653, 45), ('radius', 'R10.6391', (122.4775, 170.1615), 5.6134, 135), ('radius', 'R17.7305', (122.2805, 117.4687), 9.3549, 45), ('radius', 'R10.6511', (122.4775, 117.193), 5.6197, 135), ('horizontal', '21.0676', (116.2934, 127.9462), (127.409, 127.9462), (121.8512, 138.9462)), ('vertical', '58.8652', (127.409, 127.9462), (127.409, 159.0045), (116.409, 143.4753)), ('horizontal', '6.383', (112.9256, 117.4687), (116.2934, 117.4687), (114.6095, 128.4687)), ('vertical', '19.8581', (116.2934, 117.4687), (116.2934, 127.9462), (105.2934, 122.7074)), ('horizontal', '17.0213', (145.6354, 117.4687), (154.6162, 117.4687), (150.1258, 128.4687)), ('horizontal', '17.0213', (145.6354, 117.4687), (154.6162, 117.4687), (150.1258, 128.4687))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0078_00783518_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0082_00829320","images":["images/0082_00829320.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 10 straight edges. It is extruded to a thickness of 82.85 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 9 straight edges. It is extruded to a thickness of 82.85 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of 3.45 mm. A union feature: The part is a rectangular plate 26.47 mm wide and 13.37 mm tall. It is extruded to a thickness of 3.45 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.5165038734457426\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(36.586988, 167.845899), (37.788159, 169.647656)], [(41.992261, 172.05), (93.642648, 172.05), (93.642648, 172.006207), (145.293035, 172.006207)], [(149.497137, 169.603864), (150.698308, 167.802106)], [(150.097723, 166.600934), (144.692449, 166.600934)], [(139.887762, 168.402692), (93.642648, 168.402692), (93.642648, 168.446485), (47.397534, 168.446485)], [(44.99519, 167.845899), (44.99519, 167.245313)], [(42.592847, 166.644727), (37.187574, 166.644727)], [(100.774606, 161.533491), (100.774606, 168.402692)], [(100.774606, 161.533491), (96.457894, 161.533491)], [(91.421731, 161.533491), (87.10502, 161.533491)], [(87.10502, 168.440229), (87.10502, 161.533491)], [(87.10502, 168.440229), (91.94637, 168.440229)], [(37.788159, 61.95), (41.992261, 61.95)], [(37.788159, 147.533491), (41.992261, 147.533491)], [(37.788159, 147.533491), (37.788159, 61.95)], [(36.586988, 147.533491), (37.788159, 147.533491)], [(36.586988, 61.95), (37.788159, 61.95)], [(41.992261, 147.533491), (93.642648, 147.533491), (145.293035, 147.533491), (149.497137, 147.533491), (150.698308, 147.533491), (150.829522, 147.533491)], [(36.455775, 147.533491), (36.586988, 147.533491)], [(93.642648, 61.95), (93.642648, 147.533491)], [(41.992261, 61.95), (93.642648, 61.95), (145.293035, 61.95), (149.497137, 61.95), (150.698308, 61.95), (150.829522, 61.95)], [(36.455775, 61.95), (36.586988, 61.95)], [(149.497137, 61.95), (149.497137, 147.533491)], [(36.455775, 147.533491), (36.455775, 61.95)], [(150.829522, 147.533491), (150.829522, 61.95)], [(41.992261, 61.95), (41.992261, 147.533491)], [(36.586988, 147.533491), (36.586988, 61.95)], [(145.293035, 147.533491), (145.293035, 61.95)], [(150.698308, 61.95), (150.698308, 147.533491)], [(250.413012, 169.647656), (250.413012, 172.05)], [(164.829522, 169.647656), (164.829522, 172.05)], [(164.829522, 169.647656), (250.413012, 169.647656)], [(164.829522, 167.845899), (164.829522, 169.647656)], [(250.413012, 167.845899), (250.413012, 169.647656)], [(164.829522, 166.600934), (164.829522, 166.618661), (164.829522, 166.644727), (164.829522, 167.845899)], [(250.413012, 172.05), (164.829522, 172.05)], [(250.413012, 166.600934), (250.413012, 166.618661), (250.413012, 166.644727), (250.413012, 167.845899)], [(164.829522, 166.644727), (250.413012, 166.644727)], [(250.413012, 166.600934), (209.404256, 166.600934)], [(205.838278, 166.600934), (164.829522, 166.600934)], [(209.404256, 166.618661), (209.404256, 161.533491)], [(205.838278, 161.533491), (205.838278, 166.618661)], [(205.838278, 161.533491), (209.404256, 161.533491)], [(164.829522, 166.618661), (250.413012, 166.618661)], [(164.829522, 167.845899), (250.413012, 167.845899)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(42.010575, 167.13819, 4.911844, 90.213631, 149.276131), (145.274721, 167.094397, 4.911844, 30.723869, 89.786369), (150.057788, 167.371634, 0.771734, -87.033801, 33.903699), (145.048238, 170.315441, 3.731507, -137.658801, -95.471301), (140.310454, 164.988478, 3.44028, 54.870007, 97.057507), (46.974842, 165.032271, 3.44028, 82.942493, 125.129993), (43.015538, 170.058941, 3.44028, -97.057507, -54.870007), (37.227508, 167.415427, 0.771734, 146.096301, -92.966199), (93.939813, 161.533491, 2.518082, -0.0, -180.0), (93.939813, 161.902601, 6.834793, 106.776677, 106.957426)]\nHIDDEN_SEGMENTS = _segments([[(37.1876, 147.5335), (37.1876, 61.95)], [(150.0977, 61.95), (150.0977, 147.5335)], [(144.6924, 61.95), (144.6924, 147.5335)], [(142.2901, 61.95), (142.2901, 147.5335)], [(139.8878, 61.95), (139.8878, 147.5335)], [(100.7746, 106.5247), (100.7746, 102.9588)], [(47.3975, 61.95), (47.3975, 147.5335)], [(93.6426, 102.9588), (91.967, 102.9588)], [(91.967, 106.5247), (91.967, 102.9588)], [(93.6426, 106.5247), (91.967, 106.5247)], [(44.9952, 61.95), (44.9952, 147.5335)], [(42.5928, 61.95), (42.5928, 147.5335)], [(87.105, 102.9588), (91.9464, 102.9588), (91.967, 102.9588)], [(87.105, 106.5247), (91.9464, 106.5247), (91.967, 106.5247)], [(91.9464, 106.5247), (91.9464, 102.9588)], [(87.105, 106.5247), (87.105, 102.9588)], [(91.4217, 102.9588), (91.4217, 106.5247)], [(96.4579, 102.9588), (96.4579, 106.5247)], [(100.7746, 106.5247), (96.4579, 106.5247), (93.6426, 106.5247), (91.4217, 106.5247)], [(93.6426, 102.9588), (96.4579, 102.9588), (100.7746, 102.9588)], [(93.6426, 102.9588), (91.4217, 102.9588)], [(250.413, 168.4027), (164.8295, 168.4027)], [(250.413, 168.4465), (164.8295, 168.4465)], [(250.413, 167.2453), (164.8295, 167.2453)], [(209.4043, 168.4402), (209.4043, 168.4465)], [(205.8383, 168.4402), (205.8383, 168.4465)], [(205.8383, 168.4402), (209.4043, 168.4402)], [(205.8383, 168.4027), (205.8383, 168.4402), (205.8383, 168.4465)], [(209.4043, 168.4465), (209.4043, 168.4402), (209.4043, 168.4027)], [(164.8295, 168.4288), (250.413, 168.4288)], [(164.8295, 168.4726), (250.413, 168.4726)], [(205.8383, 164.0516), (209.4043, 164.0516)]])\nDIMENSIONS = [('horizontal', '10.4651', (42.5929, 166.6447), (37.1876, 166.6447), (39.8902, 155.6447)), ('horizontal', '89.5349', (93.6426, 168.4465), (47.3975, 168.4465), (70.5201, 157.4465)), ('horizontal', '100', (41.9923, 172.05), (93.6426, 172.05), (67.8175, 183.05)), ('vertical', '1.1628', (44.9952, 167.8459), (44.9952, 167.2453), (55.9952, 167.5456)), ('vertical', '6.9767', (93.6426, 172.05), (93.6426, 168.4465), (104.6426, 170.2482)), ('aligned', '4.1925', (36.587, 167.8459), (37.7882, 169.6476), (28.0351, 174.8486)), ('radius', 'R9.5098', (42.0106, 167.1382), 4.9118, 45), ('radius', 'R6.6607', (46.9748, 165.0323), 3.4403, 45), ('radius', 'R1.4941', (37.2275, 167.4154), 0.7717, 45), ('horizontal', '110.465', (93.6426, 172.0062), (150.6983, 172.0062), (122.1705, 183.0062)), ('vertical', '10.4651', (150.6983, 172.0062), (150.6983, 166.6009), (161.6983, 169.3036)), ('horizontal', '110.465', (36.587, 172.05), (93.6426, 172.05), (65.1148, 183.05)), ('vertical', '0.0848', (93.6426, 172.05), (93.6426, 172.0062), (104.6426, 172.0281)), ('aligned', '4.1925', (149.4971, 169.6038), (150.6983, 167.8021), (159.2502, 174.8048)), ('radius', 'R9.5098', (145.2747, 167.0944), 4.9118, 45), ('radius', 'R1.4941', (150.0578, 167.3716), 0.7717, 45), ('radius', 'R7.2245', (145.0482, 170.3154), 3.7315, 45), ('radius', 'R6.6607', (140.3105, 164.9885), 3.4403, 45), ('radius', 'R13.2328', (93.9398, 161.9026), 6.8348, 45), ('radius', 'R4.8752', (93.9398, 161.9026), 2.5181, 135), ('horizontal', '26.4656', (87.105, 168.4402), (100.7746, 168.4402), (93.9398, 179.4402)), ('vertical', '13.3721', (100.7746, 168.4402), (100.7746, 161.5335), (111.7746, 164.9868)), ('horizontal', '97.8076', (36.587, 172.05), (87.105, 172.05), (61.846, 183.05)), ('vertical', '6.9889', (87.105, 172.05), (87.105, 168.4402), (98.105, 170.2451)), ('radius', 'R4.8752', (93.9398, 161.5335), 2.5181, 225), ('horizontal', '165.698', (250.413, 169.6476), (164.8295, 169.6476), (207.6213, 158.6476)), ('horizontal', '165.698', (250.413, 172.0062), (164.8295, 172.0062), (207.6213, 161.0062))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0082_00829320_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0085_00855549","images":["images/0085_00855549.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 59.46 mm wide and 100 mm tall. It is extruded to a thickness of 74.28 mm. A union feature: The part is a rectangular plate 61.36 mm wide and 25.84 mm tall. It is extruded to a thickness of 8.07 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.24909434660547314\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(111.116771, 137.059699), (111.116771, 112.150264), (111.116771, 106.116617)], [(125.927786, 112.150264), (125.927786, 137.059699)], [(126.40201, 106.116617), (126.40201, 112.266708)], [(79.584616, 92.116617), (157.934165, 92.116617)], [(86.471866, 73.613434), (150.572691, 73.613434)], [(79.584616, 90.105402), (157.934165, 90.105402)], [(150.572691, 73.613434), (150.572691, 90.105402)], [(86.471866, 73.613434), (86.471866, 90.105402)], [(157.934165, 90.105402), (157.934165, 92.116617)], [(79.584616, 90.105402), (79.584616, 92.116617)], [(171.934165, 106.116617), (171.934165, 183.713434)], [(173.94538, 112.150264), (190.437348, 112.150264)], [(171.934165, 106.116617), (173.94538, 106.116617)], [(190.437348, 112.150264), (190.437348, 175.383803)], [(173.94538, 106.116617), (173.94538, 183.713434)], [(190.437348, 175.383803), (173.94538, 175.383803)], [(173.94538, 183.713434), (171.934165, 183.713434)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(118.522279, 143.77166, 9.994597, -42.1875, -137.8125), (118.522279, 143.333391, 32.050412, -76.640625, -103.359375), (118.75939, 144.734064, 33.076612, -56.716213, -142.500132), (118.75939, 144.538659, 39.174774, -78.75, -101.25)]\nHIDDEN_SEGMENTS = [(111.1168, 112.1503, 92.5179, 124.5984), (136.9114, 117.0833, 126.402, 112.2667), (111.1168, 92.1166, 111.1168, 73.6134), (125.9278, 92.1166, 125.9278, 73.6134), (126.402, 90.1054, 126.402, 92.1166), (136.9114, 90.1054, 136.9114, 92.1166), (92.5179, 90.1054, 92.5179, 92.1166), (128.5169, 73.6134, 128.5169, 92.1166), (108.5277, 73.6134, 108.5277, 92.1166), (151.836, 90.1054, 151.836, 92.1166), (85.6828, 90.1054, 85.6828, 92.1166), (171.9342, 137.0597, 190.4373, 137.0597), (173.9454, 117.0833, 171.9342, 117.0833), (173.9454, 124.5984, 171.9342, 124.5984), (190.4373, 153.7663, 171.9342, 153.7663), (173.9454, 177.8107, 171.9342, 177.8107)]\nDIMENSIONS = [('vertical', '100', (125.9278, 112.1503), (125.9278, 137.0597), (114.9278, 124.605)), ('radius', 'R128.668', (118.5223, 143.3334), 32.0504, 45), ('radius', 'R40.1237', (118.5223, 143.7717), 9.9946, 135), ('horizontal', '61.3633', (111.1168, 106.1166), (126.402, 106.1166), (118.7594, 117.1166)), ('vertical', '25.8372', (126.402, 106.1166), (126.402, 112.5525), (115.402, 109.3346)), ('vertical', '0', (111.1168, 112.1503), (111.1168, 112.1503), (111.1168, 112.1503)), ('vertical', '24.2223', (111.1168, 112.1503), (111.1168, 106.1166), (122.1168, 109.1334)), ('radius', 'R157.269', (118.7594, 144.5386), 39.1748, 225), ('radius', 'R132.787', (118.7594, 144.7341), 33.0766, 315), ('horizontal', '8.0741', (171.9342, 106.1166), (173.9454, 106.1166), (172.9398, 117.1166))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0085_00855549_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0086_00865882","images":["images/0086_00865882.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 6.81 mm wide and 23.96 mm tall. It is extruded to a thickness of 100 mm. A cut feature: The part is a polygonal plate with 8 straight edges. It is extruded to a thickness of -3.12 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 6 straight edges. It is extruded to a thickness of -3.12 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7752605042016827\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(172.623569, 117.352481), (172.623569, 117.675506)], [(172.623569, 117.352481), (95.097519, 117.352481), (95.097519, 133.503742)], [(129.372194, 133.503742), (95.097519, 133.503742)], [(132.636448, 130.239487), (129.372194, 133.503742)], [(138.348894, 133.503742), (135.08464, 130.239487)], [(172.623569, 133.503742), (138.348894, 133.503742)], [(172.623569, 124.408032), (172.623569, 133.503742)], [(129.984241, 124.408032), (172.623569, 124.408032)], [(117.267249, 131.888616), (129.984241, 124.408032)], [(101.558023, 131.888616), (117.267249, 131.888616)], [(124.747833, 117.675506), (101.558023, 131.888616)], [(172.623569, 117.675506), (124.747833, 117.675506)], [(172.623569, 117.675506), (172.623569, 124.408032)], [(172.623569, 133.503742), (172.623569, 135.926431)], [(95.097519, 135.926431), (95.097519, 133.503742)], [(172.623569, 135.926431), (95.097519, 135.926431)], [(129.372194, 98.073569), (95.097519, 98.073569)], [(132.636448, 98.073569), (129.372194, 98.073569)], [(132.636448, 98.073569), (135.08464, 98.073569)], [(138.348894, 98.073569), (135.08464, 98.073569)], [(172.623569, 98.073569), (138.348894, 98.073569)], [(172.623569, 98.073569), (172.623569, 100.122229), (172.623569, 103.352481)], [(138.348894, 98.073569), (138.348894, 100.122229)], [(129.372194, 98.073569), (129.372194, 100.122229)], [(95.097519, 98.073569), (95.097519, 100.122229), (95.097519, 103.352481)], [(172.623569, 103.352481), (95.097519, 103.352481)], [(172.623569, 100.122229), (95.097519, 100.122229)], [(135.08464, 98.073569), (135.08464, 100.122229)], [(132.636448, 98.073569), (132.636448, 100.122229)], [(191.902481, 117.352481), (191.902481, 133.503742), (189.853821, 133.503742)], [(186.623569, 117.352481), (191.902481, 117.352481)], [(189.853821, 135.926431), (189.853821, 133.503742)], [(189.853821, 135.926431), (186.623569, 135.926431), (186.623569, 117.352481)]])\nVISIBLE_CIRCLES = []\nVISIBLE_ARCS = [(133.860544, 131.463583, 1.731133, -135.0, -45.0)]\nHIDDEN_SEGMENTS = _segments([[(124.7478, 98.0736), (124.7478, 100.1222)], [(101.558, 98.0736), (101.558, 100.1222)], [(117.2672, 98.0736), (117.2672, 100.1222)], [(129.9842, 98.0736), (129.9842, 100.1222)], [(191.9025, 124.408), (189.8538, 124.408)], [(191.9025, 131.8886), (189.8538, 131.8886)], [(189.8538, 130.2395), (189.8538, 129.7325)], [(189.8538, 131.8886), (189.8538, 130.2395), (189.8538, 117.6755)], [(189.8538, 129.7325), (191.9025, 129.7325)]])\nDIMENSIONS = [('horizontal', '100', (95.0975, 130.2395), (172.6236, 130.2395), (133.8605, 141.2395)), ('vertical', '7.3684', (172.6236, 130.2395), (172.6236, 135.9519), (161.6236, 133.0957)), ('radius', 'R2.233', (133.8605, 131.4636), 1.7312, 45), ('horizontal', '91.6667', (101.558, 117.6755), (172.6236, 117.6755), (137.0908, 128.6755)), ('vertical', '18.3333', (172.6236, 117.6755), (172.6236, 131.8886), (161.6236, 124.7821)), ('horizontal', '100', (172.6236, 98.0736), (95.0975, 98.0736), (133.8605, 87.0736))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0086_00865882_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0088_00884424","images":["images/0088_00884424.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectilinear stepped plate with 8 edges within a 100 x 43.86 mm bounding box. It is extruded to a thickness of 88.54 mm. A cut feature: The part is a rectangular plate 21.56 mm wide and 34.72 mm tall. It is extruded to a thickness of -55.56 mm. A cut feature: The part is a circular plate with diameter 13.74 mm. It is extruded to a thickness of -55.56 mm. A cut feature: The part is a circular plate with diameter 13.74 mm. It is extruded to a thickness of -55.56 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6647285714286025\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(111.153579, 142.349278), (111.153579, 171.50404)], [(51.677865, 142.349278), (111.153579, 142.349278)], [(111.153579, 171.50404), (162.46596, 171.50404), (162.46596, 163.340707), (118.150722, 163.340707), (118.150722, 135.352135), (51.677865, 135.352135), (51.677865, 142.349278)], [(111.153579, 62.49596), (111.153579, 121.352135)], [(51.677865, 62.49596), (51.677865, 121.352135), (111.153579, 121.352135)], [(51.677865, 62.49596), (111.153579, 62.49596)], [(111.153579, 121.352135), (162.46596, 121.352135)], [(162.46596, 62.49596), (162.46596, 121.352135)], [(111.153579, 62.49596), (162.46596, 62.49596)], [(161.79783, 106.349581), (161.79783, 83.268728)], [(147.463405, 106.349581), (161.79783, 106.349581)], [(161.79783, 83.268728), (147.463405, 83.268728)], [(176.46596, 142.349278), (176.46596, 171.50404)], [(235.322135, 171.50404), (176.46596, 171.50404)], [(235.322135, 142.349278), (235.322135, 171.50404)], [(235.322135, 142.349278), (176.46596, 142.349278)], [(235.322135, 135.352135), (235.322135, 142.349278)], [(176.46596, 135.352135), (176.46596, 142.349278)], [(235.322135, 135.352135), (176.46596, 135.352135)]])\nVISIBLE_CIRCLES = [(66.72901, 110.965751, 4.567579), (66.72901, 74.036386, 4.567579)]\nVISIBLE_ARCS = [(147.463405, 94.809154, 11.540427, 90.0, -90.0)]\nHIDDEN_SEGMENTS = [(71.2966, 135.425, 71.2966, 142.3493), (161.7978, 163.3407, 161.7978, 171.504), (62.1614, 142.3493, 62.1614, 135.425), (135.923, 171.504, 135.923, 163.3407), (118.1507, 62.496, 118.1507, 121.3521), (235.3221, 163.3407, 176.466, 163.3407), (191.4685, 163.3407, 191.4685, 171.504), (214.5494, 163.3407, 214.5494, 171.504), (182.2848, 142.3493, 182.2848, 135.425), (191.4199, 142.3493, 191.4199, 135.425), (219.2141, 142.3493, 219.2141, 135.425), (228.3493, 142.3493, 228.3493, 135.425)]\nDIMENSIONS = [('horizontal', '66.6667', (162.466, 163.3407), (118.1507, 163.3407), (140.3084, 152.3407)), ('horizontal', '77.193', (111.1536, 171.504), (162.466, 171.504), (136.8098, 182.504)), ('horizontal', '89.4737', (51.6779, 142.3493), (111.1536, 142.3493), (81.4157, 153.3493)), ('horizontal', '100', (118.1507, 135.3522), (51.6779, 135.3522), (84.9143, 124.3522)), ('vertical', '10.5263', (51.6779, 135.3522), (51.6779, 142.3493), (40.6779, 138.8507)), ('vertical', '12.2807', (162.466, 171.504), (162.466, 163.3407), (173.466, 167.4224)), ('vertical', '42.1053', (118.1507, 163.3407), (118.1507, 135.3522), (129.1507, 149.3464)), ('vertical', '43.8596', (111.1536, 142.3493), (111.1536, 171.504), (100.1536, 156.9267)), ('horizontal', '88.5417', (235.3221, 142.3493), (176.4659, 142.3493), (205.894, 131.3493)), ('radius', 'R17.3611', (147.4634, 94.8091), 11.5404, 45), ('diameter', '%%c13.7427', (66.729, 110.9658), 4.5676, 45), ('diameter', '%%c13.7427', (66.729, 74.0364), 4.5676, 45)]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0088_00884424_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0091_00916322","images":["images/0091_00916322.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a square plate 100 x 100 mm. It is extruded to a thickness of 12.5 mm. A union feature: The part is a polygonal plate with 3 straight edges. It is extruded to a thickness of 12.5 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a circular plate with diameter 10 mm. It is extruded to a thickness of -12.5 mm. A cut feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -12.5 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 2 straight edges. It is extruded to a thickness of -12.5 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7688\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(165.33, 95.17), (165.33, 172.05)], [(88.45, 95.17), (165.33, 95.17)], [(165.33, 172.05), (88.45, 172.05), (88.45, 95.17)], [(146.11, 122.79875), (143.771023, 126.879518)], [(143.569632, 126.931848), (143.644276, 126.802917)], [(139.86309, 133.697614), (127.092316, 155.978539), (107.67, 122.79875)], [(165.33, 81.17), (165.33, 71.56), (88.45, 71.56)], [(88.45, 81.17), (88.45, 71.56)], [(165.33, 81.17), (88.45, 81.17)], [(146.11, 71.56), (146.11, 61.95)], [(107.67, 71.56), (107.67, 61.95)], [(146.11, 61.95), (143.771023, 61.95)], [(143.771023, 71.56), (143.771023, 61.95)], [(143.644276, 61.95), (143.771023, 61.95)], [(143.644276, 61.95), (143.644276, 71.56)], [(143.569632, 61.95), (143.644276, 61.95)], [(143.569632, 71.56), (143.569632, 61.95)], [(139.86309, 71.56), (139.86309, 61.95), (127.092316, 61.95)], [(127.092316, 71.56), (127.092316, 61.95), (107.67, 61.95)], [(139.86309, 61.95), (143.569632, 61.95)], [(179.33, 95.17), (188.94, 95.17)], [(179.33, 172.05), (188.94, 172.05)], [(179.33, 172.05), (179.33, 95.17)], [(188.94, 172.05), (188.94, 95.17)], [(198.55, 122.79875), (198.55, 117.60661)], [(188.94, 122.79875), (198.55, 122.79875)], [(188.94, 155.978539), (198.55, 155.978539), (198.55, 122.79875)], [(198.55, 117.60661), (188.94, 117.60661)]])\nVISIBLE_CIRCLES = [(128.731917, 130.406667, 3.844)]\nVISIBLE_ARCS = [(126.89, 155.776491, 38.169881, -120.234375, -59.765625), (141.673805, 130.206458, 3.932792, -59.931417, -57.773713), (141.673805, 130.206458, 3.932792, 117.413859, 120.068583), (141.637978, 130.271789, 3.858303, 120.094241, -59.957076)]\nHIDDEN_SEGMENTS = [(132.5759, 61.95, 132.5759, 71.56), (137.7797, 71.56, 137.7797, 61.95), (124.8879, 71.56, 124.8879, 61.95), (188.94, 126.8795, 198.55, 126.8795), (198.55, 126.8029, 188.94, 126.8029), (188.94, 126.9318, 198.55, 126.9318), (188.94, 133.6976, 198.55, 133.6976), (188.94, 126.4135, 198.55, 126.4135), (188.94, 126.5627, 198.55, 126.5627), (188.94, 134.2507, 198.55, 134.2507)]\nDIMENSIONS = [('horizontal', '100', (165.33, 172.05), (88.45, 172.05), (126.89, 161.05)), ('vertical', '100', (165.33, 95.17), (165.33, 172.05), (154.33, 133.61)), ('horizontal', '50', (107.67, 122.7988), (146.11, 122.7988), (126.89, 133.7988)), ('vertical', '43.1579', (146.11, 122.7988), (146.11, 155.9785), (135.11, 139.3886)), ('horizontal', '25', (88.45, 95.17), (107.67, 95.17), (98.06, 106.17)), ('vertical', '35.9375', (107.67, 95.17), (107.67, 122.7988), (96.67, 108.9844)), ('aligned', '49.7445', (146.11, 122.7988), (127.0923, 155.9785), (127.0577, 133.9186)), ('aligned', '50.0083', (127.0923, 155.9785), (107.67, 122.7988), (126.8743, 133.8317)), ('radius', 'R49.6486', (126.89, 155.7765), 38.1698, 45), ('diameter', '%%c10', (128.7319, 130.4066), 3.844, 45), ('horizontal', '52.3958', (88.45, 95.17), (128.7319, 95.17), (108.5909, 106.17)), ('vertical', '45.8333', (128.7319, 95.17), (128.7319, 130.4066), (117.7319, 112.7883)), ('radius', 'R5.1155', (141.6738, 130.2064), 3.9328, 45), ('radius', 'R5.0186', (141.638, 130.2718), 3.8583, 135), ('horizontal', '12.5', (179.33, 95.17), (188.94, 95.17), (184.135, 106.17)), ('horizontal', '12.5', (188.94, 122.7988), (198.55, 122.7988), (193.745, 133.7988)), ('horizontal', '12.5', (198.55, 130.4066), (188.94, 130.4066), (193.745, 119.4066)), ('horizontal', '12.5', (198.55, 126.8029), (188.94, 126.8029), (193.745, 115.8029)), ('horizontal', '12.5', (198.55, 133.61), (188.94, 133.61), (193.745, 122.61))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0091_00916322_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0093_00934954","images":["images/0093_00934954.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 8.22 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -84.94 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges, featuring a circular hole of diameter 24.23 mm. It is extruded to a thickness of 8.22 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges, featuring a circular hole of diameter 24.23 mm. It is extruded to a thickness of -84.94 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 45.22 mm, featuring a circular hole of diameter 24.5 mm. It is extruded to a thickness of 8.22 mm. A union feature: The part is a circular plate with diameter 45.22 mm, featuring a circular hole of diameter 24.5 mm. It is extruded to a thickness of -84.94 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.611208424458611\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(75.666713, 172.004141), (136.515106, 166.239556)], [(132.401593, 138.944315), (78.561363, 133.789399)], [(76.460005, 133.338528), (73.991987, 132.927191)], [(74.814659, 172.004141), (75.637332, 172.004141)], [(136.515106, 118.911286), (136.515106, 61.970588)], [(75.666713, 118.911286), (75.666713, 61.970588)], [(53.6233, 118.911286), (74.814659, 118.911286), (75.637332, 118.911286), (75.666713, 118.911286)], [(53.6233, 61.970588), (74.814659, 61.970588), (75.637332, 61.970588), (75.666713, 61.970588)], [(75.637332, 61.970588), (75.637332, 118.911286)], [(74.814659, 61.970588), (74.814659, 118.911286)], [(75.666713, 118.911286), (136.514225, 118.911286), (136.515106, 118.911286)], [(149.084369, 118.911286), (136.515106, 118.911286)], [(75.666713, 61.970588), (136.514225, 61.970588), (136.515106, 61.970588), (149.084369, 61.970588), (149.084369, 118.911286)], [(53.6233, 118.911286), (53.6233, 61.970588)], [(163.084369, 132.911286), (163.084369, 172.070588)], [(220.025067, 132.911286), (220.025067, 172.070588)], [(163.084369, 132.911286), (220.025067, 132.911286)], [(163.084369, 172.070588), (220.025067, 172.070588)]])\nVISIBLE_CIRCLES = [(73.169314, 152.259998, 7.404054), (135.263469, 152.465666, 7.486321), (135.263469, 152.465666, 13.8209)]\nVISIBLE_ARCS = [(135.190328, 152.788859, 13.51578, 84.375, 125.981071), (73.37722, 152.745363, 19.394388, 80.196625, 83.220466), (73.422959, 152.615468, 19.514715, -81.04675, -74.733488), (73.202951, 152.490937, 19.579651, 85.278326, -87.690424), (73.422959, 152.615468, 19.514715, 80.393891, 83.4845)]\nHIDDEN_SEGMENTS = [(127.2496, 61.9706, 127.2496, 118.9113), (132.4016, 61.9706, 132.4016, 118.9113), (76.6795, 118.9113, 76.6795, 61.9706), (73.992, 118.9113, 73.992, 61.9706), (78.5614, 118.9113, 78.5614, 61.9706), (80.5734, 118.9113, 80.5734, 61.9706), (142.7498, 113.8871, 142.7498, 61.9706), (142.7498, 113.8871, 142.7498, 118.9113), (65.7653, 118.9113, 65.7653, 61.9706), (127.7771, 61.9706, 127.7771, 113.8871), (127.7771, 118.9113, 127.7771, 113.8871), (163.0844, 166.2396, 220.0251, 166.2396), (220.0251, 163.726, 163.0844, 163.726), (220.0251, 138.9443, 163.0844, 138.9443), (163.0844, 133.7894, 220.0251, 133.7894), (163.0844, 166.3046, 220.0251, 166.3046), (220.0251, 166.2866, 163.0844, 166.2866), (220.0251, 138.6448, 163.0844, 138.6448), (163.0844, 144.8559, 220.0251, 144.8559), (163.0844, 159.6641, 220.0251, 159.6641), (220.0251, 159.952, 168.1085, 159.952), (220.0251, 144.9793, 168.1085, 144.9793), (163.0844, 144.9793, 168.1085, 144.9793), (163.0844, 159.952, 168.1085, 159.952)]\nDIMENSIONS = [('radius', 'R22.1132', (135.1903, 152.7889), 13.5158, 45), ('radius', 'R31.7312', (73.3772, 152.7454), 19.3944, 45), ('horizontal', '99.5543', (75.6667, 172.0042), (136.5151, 172.0042), (106.0909, 183.0042)), ('vertical', '62.8764', (136.5151, 172.0042), (136.5151, 133.5736), (147.5151, 152.7889)), ('vertical', '0', (75.6667, 172.0042), (75.6667, 172.0042), (75.6667, 172.0042)), ('vertical', '0', (75.6667, 172.0042), (75.6667, 172.0042), (75.6667, 172.0042)), ('radius', 'R22.1132', (135.1903, 152.7889), 13.5158, 135), ('radius', 'R31.7312', (73.3772, 152.7454), 19.3944, 135), ('horizontal', '4.0379', (73.992, 172.0042), (76.46, 172.0042), (75.226, 183.0042)), ('vertical', '63.934', (76.46, 172.0042), (76.46, 132.9272), (87.46, 152.4657)), ('horizontal', '2.74', (75.6667, 172.0042), (73.992, 172.0042), (74.8293, 161.0042)), ('vertical', '0', (73.992, 172.0042), (73.992, 172.0042), (73.992, 172.0042)), ('diameter', '%%c24.2276', (73.1693, 152.26), 7.4041, 225), ('horizontal', '1.346', (73.992, 152.26), (73.1693, 152.26), (73.5806, 141.26)), ('vertical', '32.3035', (73.1693, 172.0042), (73.1693, 152.26), (84.1693, 162.1321)), ('radius', 'R32.0343', (73.203, 152.4909), 19.5796, 315), ('radius', 'R31.9281', (73.423, 152.6155), 19.5147, 90), ('diameter', '%%c24.2276', (73.1693, 152.26), 7.4041, 0), ('horizontal', '1.346', (73.992, 152.26), (73.1693, 152.26), (73.5806, 141.26)), ('vertical', '32.3035', (73.1693, 172.0042), (73.1693, 152.26), (84.1693, 162.1321)), ('radius', 'R32.0343', (73.203, 152.4909), 19.5796, 180), ('radius', 'R31.9281', (73.423, 152.6155), 19.5147, 270), ('diameter', '%%c45.2248', (135.2635, 152.4657), 13.8209, 225), ('diameter', '%%c24.4968', (135.2635, 152.4657), 7.4863, 315), ('diameter', '%%c45.2248', (135.2635, 152.4657), 13.8209, 90), ('diameter', '%%c24.4968', (135.2635, 152.4657), 7.4863, 0), ('horizontal', '93.1609', (168.1085, 152.4657), (163.0844, 152.4657), (165.5965, 141.4657)), ('horizontal', '93.1609', (168.1085, 152.4657), (220.0251, 152.4657), (194.0668, 173.4657))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0093_00934954_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0006_00060317","images":["images/0006_00060317.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 37.5 mm. It is extruded to a thickness of 3.09 mm. A union feature: The part is a circular plate with diameter 36.98 mm, featuring a circular hole of diameter 20.03 mm. It is extruded to a thickness of 3.61 mm. A union feature: The part is a circular plate with diameter 36.98 mm, featuring a circular hole of diameter 20.03 mm. It is extruded to a thickness of -0.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9229445602334296\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(171.184696, 80.657185), (78.89024, 80.657185)], [(171.184696, 80.657185), (171.184696, 77.803027), (78.89024, 77.803027)], [(141.56154, 80.657185), (141.56154, 81.132878), (107.43182, 81.132878)], [(141.56154, 77.327334), (107.43182, 77.327334)], [(141.56154, 77.803027), (141.56154, 77.327334)], [(78.89024, 77.803027), (78.89024, 80.657185)], [(107.43182, 81.132878), (107.43182, 80.657185)], [(107.43182, 77.327334), (107.43182, 77.803027)], [(185.660389, 187.427334), (185.660389, 95.132878)], [(188.514547, 187.427334), (188.514547, 95.132878)], [(185.184696, 158.344967), (185.184696, 124.215246)], [(188.99024, 158.344967), (188.99024, 124.215246)], [(188.514547, 187.427334), (185.660389, 187.427334)], [(188.514547, 95.132878), (185.660389, 95.132878)], [(185.184696, 124.215246), (185.660389, 124.215246)], [(185.184696, 158.344967), (185.660389, 158.344967)], [(188.99024, 158.344967), (188.514547, 158.344967)], [(188.99024, 124.215246), (188.514547, 124.215246)]])\nVISIBLE_CIRCLES = [(125.037468, 141.280106, 46.147228), (124.49668, 141.280106, 17.06486), (124.49668, 141.280106, 9.243466), (125.037468, 141.280106, 17.305211)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(117.1293, 77.803, 117.1293, 80.6572), (133.7401, 80.6572, 133.7401, 77.3273), (142.3427, 77.803, 142.3427, 80.6572), (115.2532, 77.3273, 115.2532, 80.6572), (188.5145, 156.6727, 185.6604, 156.6727), (188.5145, 125.8875, 185.6604, 125.8875), (188.9902, 150.5236, 185.6604, 150.5236), (188.9902, 132.0366, 185.6604, 132.0366)]\nDIMENSIONS = [('diameter', '%%c100', (125.0374, 141.2801), 46.1472, 45), ('diameter', '%%c37.5', (125.0374, 141.2801), 17.3052, 135), ('diameter', '%%c36.9792', (124.4967, 141.2801), 17.0649, 45), ('diameter', '%%c20.0304', (124.4967, 141.2801), 9.2435, 135), ('diameter', '%%c36.9792', (124.4967, 141.2801), 17.0649, 225), ('diameter', '%%c20.0304', (124.4967, 141.2801), 9.2435, 315), ('vertical', '16.6777', (185.6604, 141.2801), (185.1847, 141.2801), (185.4225, 110.2801))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0006_00060317_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0013_00137494","images":["images/0013_00137494.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 27.35 mm. A union feature: The part is a circular plate with diameter 69.11 mm. It is extruded to a thickness of 38.62 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.579012552301256\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(134.135257, 114.624058), (76.234002, 114.624058)], [(134.135257, 114.624058), (134.135257, 98.785555), (76.234002, 98.785555)], [(125.097993, 98.785555), (125.097993, 76.425314), (85.084931, 76.425314)], [(76.234002, 98.785555), (76.234002, 114.624058)], [(85.084931, 76.425314), (85.084931, 98.785555)], [(148.135258, 186.525314), (148.135258, 128.624059)], [(163.973761, 186.525314), (163.973761, 128.624059)], [(186.334002, 177.581218), (186.334002, 137.568155)], [(163.973761, 186.525314), (148.135258, 186.525314)], [(163.973761, 128.624059), (148.135258, 128.624059)], [(186.334002, 177.581218), (163.973761, 177.581218)], [(186.334002, 137.568155), (163.973761, 137.568155)]])\nVISIBLE_CIRCLES = [(105.18463, 157.574686, 28.950628), (105.091462, 157.574686, 20.006531)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (105.1847, 157.5747), 28.9506, 45), ('diameter', '%%c69.1057', (105.0915, 157.5747), 20.0065, 135), ('horizontal', '27.3543', (148.1353, 157.5747), (163.9737, 157.5747), (156.0545, 168.5747)), ('horizontal', '65.9722', (163.9737, 157.5747), (186.334, 157.5747), (175.1539, 178.5747))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0013_00137494_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0016_00162900","images":["images/0016_00162900.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 25 mm. It is extruded to a thickness of -65.07 mm. A union feature: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 41.67 mm. It is extruded to a thickness of 65.07 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4175773809523898\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(123.683091, 126.731696), (81.925353, 126.731696)], [(123.683091, 126.731696), (123.683091, 72.389434), (81.925353, 72.389434)], [(81.925353, 126.731696), (81.925353, 72.389434)], [(137.683092, 182.489435), (137.683092, 140.731697)], [(192.025354, 182.489435), (192.025354, 140.731697)], [(137.683092, 140.731697), (192.025354, 140.731697)], [(137.683092, 182.489435), (192.025354, 182.489435)]])\nVISIBLE_CIRCLES = [(102.804222, 161.610566, 20.878869), (102.804222, 161.610566, 8.699529), (102.804222, 161.610566, 5.219717)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(108.0239, 99.5606), (108.0239, 126.7317)], [(111.5038, 99.5606), (94.1047, 99.5606)], [(111.5038, 99.5606), (111.5038, 72.3894)], [(97.5845, 126.7317), (97.5845, 99.5606)], [(94.1047, 72.3894), (94.1047, 99.5606)], [(164.8542, 170.3101), (164.8542, 152.911)], [(164.8542, 166.8303), (164.8542, 161.6106), (164.8542, 156.3908)], [(164.8542, 166.8303), (164.8542, 170.3101)], [(137.6831, 156.3908), (164.8542, 156.3908)], [(137.6831, 166.8303), (164.8542, 166.8303)], [(192.0254, 170.3101), (164.8542, 170.3101)], [(192.0254, 152.911), (164.8542, 152.911)]])\nDIMENSIONS = [('diameter', '%%c100', (102.8042, 161.6106), 20.8789, 45), ('diameter', '%%c25', (102.8042, 161.6106), 5.2197, 135), ('diameter', '%%c100', (102.8042, 161.6106), 20.8789, 225), ('diameter', '%%c41.6667', (102.8042, 161.6106), 8.6995, 315), ('horizontal', '130.137', (164.8542, 161.6106), (137.6831, 161.6106), (151.2687, 150.6106))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0016_00162900_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0019_00191750","images":["images/0019_00191750.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 97.92 mm. It is extruded to a thickness of 49.48 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 4700.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.01981443298969211\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(90.431443, 155.583516), (88.45, 155.583516), (88.45, 62.445361), (88.57384, 62.445361), (88.69768, 62.445361), (88.821521, 62.445361), (88.945361, 62.445361), (89.069201, 62.445361), (89.193041, 62.445361), (89.316881, 62.445361), (89.440722, 62.445361), (89.564562, 62.445361), (89.688402, 62.445361), (89.812242, 62.445361), (89.936082, 62.445361), (90.059923, 62.445361), (90.183763, 62.445361), (90.307603, 62.445361), (90.431443, 62.445361)], [(90.431443, 155.583516), (90.431443, 156.563917)], [(88.49128, 156.563917), (90.431443, 156.563917)], [(88.49128, 156.563917), (88.49128, 155.583516)], [(105.411845, 172.545361), (105.411845, 171.554639)], [(198.55, 171.554639), (198.55, 170.563918)], [(198.55, 172.545361), (198.55, 171.554639)], [(105.411845, 171.554639), (105.411845, 170.563918)], [(104.431443, 170.584558), (104.431443, 172.524721)], [(198.55, 172.545361), (105.411845, 172.545361)], [(198.55, 170.563918), (105.411845, 170.563918)], [(104.431443, 170.584558), (105.411845, 170.584558)], [(104.431443, 172.524721), (105.411845, 172.524721)]])\nVISIBLE_CIRCLES = [(89.440722, 171.554639, 0.990722)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(90.4314, 171.5547), (88.45, 171.5546), (90.4314, 171.5546), (90.4314, 171.5547)]])\nDIMENSIONS = [('diameter', '%%c97.9167', (89.4614, 171.5546), 0.9701, 45), ('diameter', '%%c100', (89.4407, 171.5546), 0.9907, 135), ('horizontal', '49.4792', (105.4118, 171.5546), (198.55, 171.5546), (151.9809, 192.5546))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0019_00191750_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0021_00213655","images":["images/0021_00213655.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 102.86 mm. A union feature: The part is a circular plate with diameter 36.84 mm. It is extruded to a thickness of 22.14 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4271111111111111\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(123.890387, 126.016667), (81.179276, 126.016667)], [(123.890387, 126.016667), (123.890387, 82.08206), (81.179276, 82.08206)], [(110.262171, 82.08206), (110.262171, 72.627778), (94.526498, 72.627778)], [(81.179276, 82.08206), (81.179276, 126.016667)], [(94.526498, 72.627778), (94.526498, 82.08206)], [(137.890388, 182.727778), (137.890388, 140.016667)], [(181.824994, 182.727778), (181.824994, 140.016667)], [(191.279276, 169.240059), (191.279276, 153.504386)], [(181.824994, 182.727778), (137.890388, 182.727778)], [(181.824994, 140.016667), (137.890388, 140.016667)], [(191.279276, 169.240059), (181.824994, 169.240059)], [(191.279276, 153.504386), (181.824994, 153.504386)]])\nVISIBLE_CIRCLES = [(102.534832, 161.372222, 21.355556), (102.394335, 161.372222, 7.867836)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (102.5348, 161.3722), 21.3556, 45), ('diameter', '%%c36.8421', (102.3943, 161.3722), 7.8678, 135), ('horizontal', '102.865', (137.8904, 161.3722), (181.825, 161.3722), (159.8577, 172.3722)), ('horizontal', '125', (181.825, 161.3722), (191.2793, 161.3722), (186.5521, 182.3722))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0021_00213655_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0097_00970662","images":["images/0097_00970662.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 18.55 mm. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of -0.52 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.807087620175879\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(148.981571, 97.102449), (148.981571, 82.12719), (68.272809, 82.12719)], [(148.981571, 97.102449), (148.981571, 97.518428), (68.272809, 97.518428)], [(68.272809, 82.12719), (68.272809, 97.102449)], [(68.272809, 97.518428), (68.272809, 97.102449)], [(178.37281, 192.227191), (178.37281, 111.518429)], [(162.981572, 192.227191), (162.981572, 111.518429)], [(178.37281, 192.227191), (163.397551, 192.227191)], [(178.37281, 111.518429), (163.397551, 111.518429)], [(162.981572, 111.518429), (163.397551, 111.518429)], [(162.981572, 192.227191), (163.397551, 192.227191)]])\nVISIBLE_CIRCLES = [(108.62719, 151.87281, 40.354381)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (108.6272, 151.8728), 40.3544, 45), ('diameter', '%%c100', (108.6272, 151.8728), 40.3544, 135), ('horizontal', '19.0701', (163.3976, 151.8728), (178.3728, 151.8728), (170.8852, 162.8728))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0097_00970662_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0010_00103711","images":["images/0010_00103711.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 3.61 mm. A cut feature: The part is a circular plate with diameter 22.92 mm. It is extruded to a thickness of -55.66 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(87.225036, 90.307154), (160.695036, 90.307154), (160.695036, 92.957846)], [(87.225036, 92.957846), (160.695036, 92.957846)], [(87.225036, 92.957846), (87.225036, 90.307154)], [(177.345728, 106.957846), (177.345728, 180.427846)], [(174.695036, 106.957846), (174.695036, 180.427846)], [(174.695036, 106.957846), (177.345728, 106.957846)], [(174.695036, 180.427846), (177.345728, 180.427846)]])\nVISIBLE_CIRCLES = [(123.960036, 143.692846, 36.735), (123.665072, 143.692846, 8.418437)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(132.0835, 92.9578, 132.0835, 90.3072), (115.2466, 90.3072, 115.2466, 92.9578), (177.3457, 152.1113, 174.695, 152.1113), (177.3457, 135.2744, 174.695, 135.2744)]\nDIMENSIONS = [('diameter', '%%c100', (123.96, 143.6928), 36.735, 45), ('diameter', '%%c22.9167', (123.6651, 143.6928), 8.4184, 135), ('horizontal', '3.6079', (177.3457, 143.6928), (174.695, 143.6928), (176.0204, 132.6928))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0010_00103711_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0015_00155017","images":["images/0015_00155017.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 50 mm. It is extruded to a thickness of 395.83 mm. A cut feature: The part is a circular plate with diameter 58.33 mm. It is extruded to a thickness of -49.48 mm. A cut feature: The part is a circular plate with diameter 58.33 mm. It is extruded to a thickness of 49.48 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.1938151260504191\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(107.18521, 133.398073), (107.18521, 138.71896)], [(105.524869, 138.71896), (103.307225, 138.71896)], [(99.091437, 133.251755), (99.091437, 138.71896), (96.301251, 138.71896)], [(96.301251, 133.230331), (96.301251, 138.71896)], [(92.001343, 138.71896), (89.867819, 138.71896)], [(88.005767, 133.066019), (88.005588, 133.066326)], [(107.387101, 138.71896), (107.387101, 62.000473), (88.005588, 62.000473)], [(107.387101, 138.71896), (107.18521, 138.71896)], [(105.524869, 138.71896), (105.609453, 138.71896)], [(89.783236, 138.71896), (89.867819, 138.71896)], [(88.005588, 62.000473), (88.005588, 133.066325)], [(126.707986, 164.377504), (121.387101, 164.377504)], [(121.387101, 172.100473), (121.387101, 171.999527)], [(126.87573, 171.999527), (121.387101, 171.999527)], [(121.387101, 170.250489), (121.387101, 168.121542)], [(121.387101, 156.81566), (121.387101, 154.568944)], [(126.87573, 152.819906), (121.387101, 152.819906), (121.387101, 152.71896)], [(126.664253, 160.441929), (121.387101, 160.441929)], [(198.105588, 172.100473), (198.105588, 152.71896)], [(121.387101, 160.441929), (121.387101, 164.377504)], [(121.387101, 170.250489), (121.387101, 170.310905)], [(121.387101, 154.568944), (121.387101, 154.508528)], [(198.105588, 172.100473), (121.387101, 172.100473)], [(198.105588, 152.71896), (121.387101, 152.71896)]])\nVISIBLE_CIRCLES = [(97.696344, 162.409716, 9.690756), (97.696344, 162.409716, 4.845378), (121.387101, 162.468601, 5.652941), (97.654283, 138.71896, 5.652942)]\nVISIBLE_ARCS = [(116.733064, 139.296897, 11.223085, -177.048225, -148.291534), (97.654279, 138.718956, 5.652936, 179.99996, -103.848149), (77.958823, 139.508582, 11.935145, -32.669861, -3.793423), (77.044377, 139.619257, 12.770633, -30.87221, -4.042557), (117.139202, 139.287904, 11.543777, -177.17499, -149.573782), (97.654284, 138.71896, 5.652941, -180.0, -126.666847), (120.716177, 182.177953, 11.885999, -86.764132, -58.907802), (120.724934, 181.814833, 11.583286, -86.722857, -57.926537), (120.724934, 143.0046, 11.583286, 57.926537, 86.722857), (120.716177, 142.64148, 11.885999, 58.907802, 86.764132)]\nHIDDEN_SEGMENTS = _segments([[(105.5915, 168.029), (105.7681, 167.7723)], [(106.0498, 167.322), (106.3362, 166.7988)], [(106.8425, 165.6126), (107.0133, 165.0753)], [(105.5249, 168.1215), (103.3072, 170.3109)], [(103.2143, 170.3761), (102.9571, 170.5482)], [(102.5153, 170.8174), (101.9306, 171.1265)], [(100.6274, 171.6466), (99.959, 171.8326)], [(99.0914, 171.9995), (96.3013, 171.9995), (95.5343, 171.8562)], [(94.8747, 171.6806), (94.263, 171.4719)], [(93.0597, 170.9193), (92.5943, 170.6486)], [(92.255, 170.4286), (92.0456, 170.2825)], [(92.0013, 170.2505), (89.8678, 168.1215)], [(89.8014, 168.0293), (89.6254, 167.7736)], [(89.3466, 167.3283), (89.0542, 166.7943)], [(88.5114, 165.4995), (88.3366, 164.9211)], [(89.7832, 156.8157), (92.0013, 154.5689)], [(96.3013, 152.8199), (95.5343, 152.9632)], [(94.8747, 153.1388), (94.263, 153.3476)], [(93.0597, 153.9002), (92.5943, 154.1708)], [(92.255, 154.3908), (92.0013, 154.5689)], [(96.3013, 152.8199), (99.0914, 152.8199)], [(103.2143, 154.4433), (102.9571, 154.2712)], [(102.5153, 154.0021), (101.9306, 153.693)], [(100.6274, 153.1728), (99.959, 152.9868)], [(103.3072, 154.5085), (105.6095, 156.8157)], [(107.1852, 160.4419), (107.0007, 159.7006)], [(106.8456, 159.2157), (106.561, 158.4944)], [(105.7879, 157.077), (105.6095, 156.8157)], [(107.1852, 160.4419), (107.3871, 162.4097), (107.1852, 164.3775)], [(107.1852, 160.4419), (107.1852, 164.3775)], [(103.3072, 168.1215), (105.5249, 168.1215)], [(103.3072, 168.1215), (101.0717, 165.886)], [(102.4416, 163.3898), (102.177, 164.254)], [(101.4226, 159.3125), (102.0432, 160.269)], [(102.2952, 160.8837), (102.4782, 161.6276)], [(101.1309, 158.9919), (103.3072, 156.8157), (105.6095, 156.8157)], [(103.3072, 168.1215), (103.3072, 170.3109)], [(99.0914, 171.9995), (96.3013, 171.9995)], [(92.0013, 170.2505), (92.0013, 168.1215), (94.2786, 165.8443)], [(99.2666, 166.9936), (98.6011, 167.1699)], [(96.4218, 167.0845), (95.5466, 166.7521)], [(94.4107, 165.9709), (94.2786, 165.8443)], [(89.8678, 168.1215), (92.0013, 168.1215)], [(89.7832, 156.8157), (92.0013, 156.8157)], [(94.22, 159.0344), (92.0013, 156.8157)], [(92.9929, 163.5739), (92.8764, 162.9058)], [(92.9942, 161.2402), (93.2562, 160.4699)], [(93.6746, 159.7073), (94.22, 159.0344)], [(92.0013, 154.5689), (92.0013, 156.8157)], [(94.22, 159.0344), (95.809, 157.947)], [(96.4502, 157.7273), (97.0928, 157.6021)], [(98.8244, 157.6975), (99.6613, 157.9806)], [(100.3869, 158.38), (101.1309, 158.9919)], [(99.0914, 152.8199), (96.3013, 152.8199)], [(103.3072, 156.8157), (103.3072, 154.5085)], [(102.5414, 133.066), (101.0717, 134.216)], [(101.1309, 134.2615), (102.5417, 133.0663)], [(101.1309, 134.2615), (103.3072, 138.719)], [(94.2786, 134.1846), (92.8513, 133.066), (92.851, 133.0663), (94.22, 134.2288)], [(96.3013, 133.2303), (99.6978, 133.4483)], [(100.2092, 133.6763), (101.1309, 134.2615)], [(102.5417, 133.0663), (102.5417, 62.0005)], [(99.0914, 133.2518), (96.3013, 133.2303)], [(102.5414, 133.066), (107.1852, 133.066)], [(88.0058, 133.066), (92.8513, 133.066)], [(92.851, 62.0005), (92.851, 133.0663)], [(126.6643, 160.4419), (125.8773, 159.0344)], [(123.8791, 157.3946), (122.9334, 157.0312)], [(126.7711, 164.1914), (126.9316, 163.5705)], [(121.3871, 168.1215), (125.8901, 165.886)], [(125.8683, 159.0227), (125.8773, 159.0344)], [(127.0381, 162.3204), (127.0397, 162.4097)], [(125.8445, 158.9919), (121.3871, 156.8157)], [(125.8901, 165.886), (127.0399, 167.2551), (127.04, 167.2549), (125.9214, 165.8443)], [(122.1385, 156.8658), (121.3871, 156.8157)], [(125.8773, 159.0344), (127.04, 157.5645), (127.0399, 157.5643), (125.8445, 158.9919)], [(122.141, 168.071), (122.2094, 168.0614), (122.8668, 167.9244)], [(121.6726, 168.1143), (122.141, 168.071)], [(123.0416, 167.874), (123.8256, 167.5685), (123.8428, 167.5603), (123.8778, 167.5433)], [(124.219, 167.3611), (126.4547, 164.9737), (126.708, 164.3775)], [(125.2615, 158.3522), (125.2138, 158.3078), (125.109, 158.2138), (125.0019, 158.1225), (124.8926, 158.0338), (124.7446, 157.9208)], [(124.7444, 157.9211), (124.4343, 157.7073)], [(125.8773, 159.0344), (125.2138, 158.3078)], [(126.9656, 163.3828), (126.7505, 164.2546)], [(126.9658, 163.3817), (127.0259, 162.0696), (126.9057, 161.2435)], [(126.825, 160.9242), (126.9057, 161.2435)], [(127.04, 171.9995), (127.04, 167.2549)], [(127.04, 152.8199), (127.04, 157.5645)], [(198.1056, 167.2551), (127.0399, 167.2551)], [(198.1056, 157.5643), (127.0399, 157.5643)]])\nDIMENSIONS = [('diameter', '%%c100', (97.6969, 162.4097), 9.6908, 45), ('diameter', '%%c50', (97.6969, 162.4097), 4.8454, 135), ('horizontal', '4.0604', (121.3871, 162.4097), (198.1056, 162.4097), (159.7463, 173.4097)), ('diameter', '%%c58.3333', (121.3871, 162.4686), 5.6529, 45), ('vertical', '1.8746', (121.3871, 171.9995), (121.3871, 152.8199), (142.3871, 162.4097)), ('horizontal', '23.9602', (107.1857, 138.719), (88.0061, 138.719), (97.5959, 127.719)), ('diameter', '%%c58.3333', (97.6548, 138.719), 5.6529, 45)]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0015_00155017_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0030_00308152","images":["images/0030_00308152.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 500 mm. A cut feature: The part is a circular plate with diameter 68.42 mm. It is extruded to a thickness of 562.5 mm. A cut feature: The part is a circular plate with diameter 68.42 mm. It is extruded to a thickness of -197.92 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.16016057328435856\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(134.206431, 90.896238), (118.190374, 90.896238)], [(134.206431, 170.976525), (134.206431, 90.896238)], [(134.206431, 170.976525), (118.190374, 170.976525)], [(118.190374, 90.896238), (118.190374, 170.976525)], [(164.222489, 90.896238), (148.206431, 90.896238)], [(164.222489, 170.976525), (148.206431, 170.976525)], [(148.206431, 157.155714), (148.206475, 157.155651), (148.41995, 157.463432), (148.626301, 157.77611), (148.82682, 158.09256), (149.020951, 158.412966), (149.207903, 158.737612), (149.386713, 159.06681), (149.556243, 159.400878), (149.715173, 159.740113), (149.861995, 160.084757), (149.995014, 160.434954), (150.112375, 160.790697), (150.212125, 161.151767), (150.292309, 161.517671), (150.351115, 161.887606), (150.387059, 162.260452), (150.399155, 162.634828), (150.387059, 163.009204), (150.351115, 163.38205), (150.292308, 163.751986), (150.212125, 164.11789), (150.112374, 164.47896), (149.995014, 164.834703), (149.861995, 165.1849), (149.715173, 165.529543), (149.556243, 165.868779), (149.386713, 166.202847), (149.207903, 166.532045), (149.020951, 166.856691), (148.826821, 167.177097), (148.626301, 167.493546), (148.41995, 167.806224), (148.206475, 168.114006), (148.206431, 168.113943)], [(164.222489, 157.155714), (164.222445, 157.155651), (164.00897, 157.463432), (163.802619, 157.77611), (163.602099, 158.09256), (163.407968, 158.412966), (163.221016, 158.737612), (163.042207, 159.06681), (162.872677, 159.400878), (162.713746, 159.740113), (162.566925, 160.084757), (162.433906, 160.434954), (162.316545, 160.790697), (162.216795, 161.151767), (162.136611, 161.517671), (162.077805, 161.887606), (162.041861, 162.260452), (162.029765, 162.634828), (162.041861, 163.009204), (162.077805, 163.38205), (162.136611, 163.751986), (162.216794, 164.11789), (162.316545, 164.47896), (162.433906, 164.834703), (162.566924, 165.1849), (162.713746, 165.529543), (162.872677, 165.868779), (163.042207, 166.202847), (163.221016, 166.532045), (163.407968, 166.856691), (163.602099, 167.177097), (163.802619, 167.493546), (164.00897, 167.806224), (164.222445, 168.114006), (164.222489, 168.113943)], [(164.222489, 90.896238), (164.222489, 157.155714)], [(164.222489, 168.113943), (164.222489, 170.976525)], [(148.206431, 90.896238), (148.206431, 157.155714)], [(148.206431, 168.113943), (148.206431, 170.976525)]])\nVISIBLE_CIRCLES = [(126.17206, 162.634828, 5.479178), (126.198402, 68.88821, 8.008029)]\nVISIBLE_ARCS = [(140.343099, 163.555096, 10.088772, -39.13958, -5.254471), (138.796624, 161.274299, 11.632935, 6.716395, 36.012027), (172.085821, 163.555096, 10.088772, -174.745529, -140.86042), (173.632296, 161.274299, 11.632935, 143.987973, 173.283605)]\nHIDDEN_SEGMENTS = [(131.6512, 68.8882, 131.6512, 74.7529), (131.6512, 68.8882, 131.6512, 63.0235), (120.6929, 74.7035, 120.6929, 68.8882), (120.6929, 63.0729, 120.6929, 68.8882), (148.2065, 157.1557, 156.2145, 157.1557), (148.2065, 168.114, 156.2145, 168.114), (164.2224, 168.114, 156.2145, 168.114), (164.2224, 157.1557, 156.2145, 157.1557)]\nDIMENSIONS = [('diameter', '%%c68.4211', (126.1721, 162.6348), 5.4792, 45), ('diameter', '%%c68.4211', (126.1721, 162.6348), 5.4792, 135), ('vertical', '500', (156.2145, 170.9765), (156.2145, 90.8962), (167.2145, 130.9364)), ('diameter', '%%c100', (126.1984, 68.8882), 8.008, 45)]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0030_00308152_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0047_00478958","images":["images/0047_00478958.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 31.44 mm. A cut feature: The part is a circular plate with diameter 87.5 mm. It is extruded to a thickness of 31.44 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.731132703182443\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(71.325977, 80.228317), (144.439247, 80.228317), (144.439247, 103.215047)], [(71.325977, 103.215047), (144.439247, 103.215047)], [(71.325977, 103.215047), (71.325977, 80.228317)], [(181.425977, 117.215047), (181.425977, 190.328318)], [(158.439248, 117.215047), (158.439248, 190.328318)], [(158.439248, 117.215047), (181.425977, 117.215047)], [(158.439248, 190.328318), (181.425977, 190.328318)]])\nVISIBLE_CIRCLES = [(107.882612, 153.771683, 36.556635), (107.835012, 153.771683, 31.987056)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(139.8221, 80.2283, 139.8221, 103.215), (75.848, 103.215, 75.848, 80.2283), (158.4392, 121.7846, 181.426, 121.7846), (158.4392, 185.7587, 181.426, 185.7587)]\nDIMENSIONS = [('diameter', '%%c100', (107.8826, 153.7717), 36.5566, 45), ('diameter', '%%c87.5', (107.835, 153.7717), 31.9871, 135), ('horizontal', '31.4399', (181.426, 153.7717), (158.4392, 153.7717), (169.9326, 142.7717))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0047_00478958_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0052_00520675","images":["images/0052_00520675.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 39.69 mm. A cut feature: The part is a circular plate with diameter 90.1 mm. It is extruded to a thickness of -34.53 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6879695498504659\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(140.863262, 106.452284), (72.066307, 106.452284)], [(140.863262, 106.452284), (140.863262, 79.149239), (72.066307, 79.149239), (72.066307, 106.452284)], [(154.863262, 189.249239), (154.863262, 120.452284)], [(182.166307, 189.249239), (182.166307, 120.452284)], [(182.166307, 189.249239), (154.863262, 189.249239)], [(182.166307, 120.452284), (154.863262, 120.452284)]])\nVISIBLE_CIRCLES = [(106.464784, 154.850761, 34.398477), (106.606618, 154.850761, 30.994461)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(137.6011, 79.1492), (137.6011, 102.9064), (75.6122, 102.9064), (75.6122, 79.1492)], [(158.4091, 185.8452), (158.4091, 123.8563), (182.1663, 123.8563)], [(158.4091, 185.8452), (182.1663, 185.8452)]])\nDIMENSIONS = [('diameter', '%%c100', (106.4648, 154.8508), 34.3985, 45), ('diameter', '%%c90.1042', (106.6066, 154.8508), 30.9945, 135), ('horizontal', '39.6864', (154.8633, 154.8508), (182.1663, 154.8508), (168.5148, 165.8508))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0052_00520675_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0005_00053852","images":["images/0005_00053852.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 7.37 mm tall. It is extruded to a thickness of 1.04 mm. A union feature: The part is a rectangular plate 100 mm wide and 1.05 mm tall. It is extruded to a thickness of 7.29 mm. A cut feature: The part is a circular plate with diameter 3.09 mm. It is extruded to a thickness of -4.17 mm. A cut feature: The part is a circular plate with diameter 3.09 mm. It is extruded to a thickness of -4.17 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 1.3562319603279023\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(198.660642, 123.992521), (198.660642, 125.420133)], [(198.660642, 135.309325), (198.660642, 125.420133)], [(63.037446, 135.309325), (198.660642, 135.309325)], [(63.037446, 123.992521), (198.660642, 123.992521)], [(63.037446, 125.420133), (63.037446, 123.992521)], [(198.660642, 125.420133), (63.037446, 125.420133), (63.037446, 135.309325)], [(198.660642, 108.579779), (198.660642, 109.992521)], [(198.660642, 108.579779), (198.660642, 98.690588)], [(63.037446, 108.579779), (63.037446, 109.992521), (198.660642, 109.992521)], [(63.037446, 108.579779), (198.660642, 108.579779)], [(198.660642, 98.690588), (63.037446, 98.690588)], [(63.037446, 108.579779), (63.037446, 98.690588)], [(214.073383, 135.309325), (212.660642, 135.309325)], [(212.660642, 125.316037), (212.660642, 135.309325)], [(214.073383, 125.316037), (212.660642, 125.316037)], [(214.073383, 125.316037), (214.073383, 123.992521), (223.962575, 123.992521)], [(223.962575, 125.420133), (223.962575, 123.992521)], [(214.073383, 125.420133), (223.962575, 125.420133)], [(214.073383, 125.420133), (214.073383, 135.309325)]])\nVISIBLE_CIRCLES = [(68.004348, 131.0711, 2.096806), (193.738352, 131.0711, 2.096806)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(70.1011, 109.9926, 70.1011, 108.5798), (195.8351, 109.9926, 195.8351, 108.5798), (65.9075, 108.5798, 65.9075, 109.9926), (191.6415, 108.5798, 191.6415, 109.9926), (214.0734, 133.1679, 212.6606, 133.1679), (214.0734, 128.9743, 212.6606, 128.9743)]\nDIMENSIONS = [('horizontal', '100', (198.6606, 125.3161), (63.0374, 125.3161), (130.849, 114.3161)), ('vertical', '7.3684', (198.6606, 135.3094), (198.6606, 125.3161), (209.6606, 130.3127)), ('horizontal', '100', (198.6606, 125.4201), (63.0374, 125.4201), (130.849, 114.4201)), ('diameter', '%%c3.0921', (68.0044, 131.0711), 2.0968, 45), ('diameter', '%%c3.0921', (193.7383, 131.0711), 2.0968, 45), ('horizontal', '1.0417', (214.0734, 135.3094), (212.6606, 135.3094), (213.367, 124.3094)), ('horizontal', '7.2917', (214.0734, 125.4201), (223.9626, 125.4201), (219.018, 136.4201)), ('horizontal', '1.0417', (212.6606, 131.0711), (218.3116, 131.0711), (215.4861, 142.0711)), ('horizontal', '1.0417', (212.6606, 131.0711), (218.3116, 131.0711), (215.4861, 142.0711))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0005_00053852_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0017_00175690","images":["images/0017_00175690.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 100 mm. A union feature: The part is a square plate 50 x 50 mm. It is extruded to a thickness of 50 mm. A cut feature: The part is a circular plate with diameter 24.74 mm. It is extruded to a thickness of -150 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.3844\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(120.415911, 172.05), (120.415911, 133.61)], [(94.924121, 172.05), (120.415911, 172.05)], [(120.415911, 133.61), (94.924121, 133.61), (94.924121, 172.05)], [(120.415911, 61.95), (120.415911, 100.39)], [(94.924121, 119.61), (94.924121, 61.95)], [(94.924121, 119.61), (114.144121, 119.61)], [(114.144121, 100.39), (114.144121, 119.61)], [(114.144121, 100.39), (120.415911, 100.39)], [(94.924121, 61.95), (120.415911, 61.95)], [(134.415911, 172.05), (192.075911, 172.05)], [(192.075911, 133.61), (153.635911, 133.61)], [(192.075911, 133.61), (192.075911, 172.05)], [(153.635911, 133.61), (153.635911, 152.83), (134.415911, 152.83), (134.415911, 172.05)]])\nVISIBLE_CIRCLES = [(104.5847, 162.44, 4.754421)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(114.1441, 152.83, 94.9241, 152.83), (114.1441, 172.05, 114.1441, 152.83), (109.3391, 119.61, 109.3391, 61.95), (99.8303, 61.95, 99.8303, 119.61), (192.0759, 167.1944, 134.4159, 167.1944), (192.0759, 157.6856, 134.4159, 157.6856)]\nDIMENSIONS = [('horizontal', '66.3158', (120.4159, 133.61), (94.9241, 133.61), (107.67, 122.61)), ('vertical', '100', (120.4159, 172.05), (120.4159, 133.61), (131.4159, 152.83)), ('horizontal', '50', (94.9241, 172.05), (114.1441, 172.05), (104.5341, 183.05)), ('vertical', '50', (114.1441, 172.05), (114.1441, 152.83), (125.1441, 162.44)), ('diameter', '%%c24.7368', (104.5847, 162.44), 4.7544, 45), ('vertical', '50', (104.5847, 172.05), (104.5847, 162.44), (115.5847, 167.245)), ('horizontal', '100', (192.0759, 172.05), (153.6359, 172.05), (172.8559, 161.05)), ('horizontal', '50', (153.6359, 172.05), (134.4159, 172.05), (144.0259, 161.05)), ('horizontal', '100', (134.4159, 162.44), (192.0759, 162.44), (163.2459, 173.44))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0017_00175690_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0017_00179027","images":["images/0017_00179027.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a square plate 100 x 100 mm, featuring a rectangular cutout 80 x 80 mm. It is extruded to a thickness of 3200 mm. A cut feature: The part is a circular plate with diameter 32.98 mm. It is extruded to a thickness of -300 mm. A cut feature: The part is a circular plate with diameter 32.98 mm. It is extruded to a thickness of -300 mm. A cut feature: The part is a circular plate with diameter 32.98 mm. It is extruded to a thickness of -300 mm. A cut feature: The part is a circular plate with diameter 33.68 mm. It is extruded to a thickness of -300 mm. A cut feature: The part is a circular plate with diameter 33.68 mm. It is extruded to a thickness of -300 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.02912121212121215\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(181.637887, 123.999979), (88.450008, 123.999979), (88.450008, 126.912101)], [(181.637887, 126.912101), (88.450008, 126.912101)], [(181.637887, 123.999979), (181.637887, 126.912101)], [(181.637887, 107.087858), (88.450008, 107.087858)], [(181.637887, 107.087858), (181.637887, 109.999979)], [(88.450008, 107.087858), (88.450008, 109.999979)], [(181.637887, 109.999979), (88.450008, 109.999979)], [(198.550008, 123.999979), (198.550008, 126.912101)], [(195.637887, 123.999979), (198.550008, 123.999979)], [(198.550008, 126.912101), (195.637887, 126.912101), (195.637887, 123.999979)], [(195.944426, 126.636215), (195.944426, 124.306518)], [(198.274123, 126.636215), (195.944426, 126.636215)], [(198.274123, 124.306518), (198.274123, 126.636215)], [(195.944426, 124.306518), (198.274123, 124.306518)]])\nVISIBLE_CIRCLES = [(93.794006, 125.941393, 0.480245), (105.442491, 125.941393, 0.480245), (176.304107, 125.941393, 0.480245), (90.391422, 108.53881, 0.490463), (179.696473, 108.53881, 0.490463)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c32.9825', (93.794, 125.9414), 0.4802, 45), ('diameter', '%%c32.9825', (176.3041, 125.9414), 0.4802, 45), ('vertical', '10.5263', (181.6379, 124.0), (181.6379, 124.0), (181.6379, 124.0)), ('vertical', '10.5263', (181.6379, 124.0), (181.6379, 125.9414), (170.6379, 124.9707)), ('diameter', '%%c32.9825', (105.4425, 125.9414), 0.4802, 45), ('vertical', '10.5263', (181.6379, 124.0), (181.6379, 124.0), (181.6379, 124.0)), ('vertical', '10.5263', (181.6379, 124.0), (181.6379, 125.9414), (170.6379, 124.9707)), ('horizontal', '100', (198.55, 126.9121), (195.6379, 126.9121), (197.0939, 115.9121)), ('vertical', '100', (198.55, 124.0), (198.55, 126.9121), (187.55, 125.4561)), ('vertical', '9.4737', (195.9444, 124.3065), (195.9444, 126.6362), (184.9444, 125.4714)), ('horizontal', '10.5263', (199.5207, 125.9414), (190.7843, 125.9414), (195.1525, 114.9414)), ('horizontal', '3200', (181.6379, 107.0879), (88.45, 107.0879), (135.0439, 96.0879)), ('diameter', '%%c33.6842', (90.3914, 108.5388), 0.4905, 45), ('vertical', '9.4737', (181.6379, 110.0), (181.6379, 108.5388), (192.6379, 109.2694)), ('vertical', '9.4737', (181.6379, 108.5388), (181.6379, 108.5388), (181.6379, 108.5388)), ('diameter', '%%c33.6842', (179.6965, 108.5388), 0.4905, 45), ('vertical', '9.4737', (181.6379, 110.0), (181.6379, 108.5388), (192.6379, 109.2694))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0017_00179027_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0029_00292321","images":["images/0029_00292321.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a square plate 100 x 100 mm, featuring a rectangular cutout 85.26 x 85.26 mm. It is extruded to a thickness of 505.26 mm. A cut feature: The part is a circular plate with diameter 5.21 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.32 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.32 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.21 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.21 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.32 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.32 mm. It is extruded to a thickness of 52.63 mm. A cut feature: The part is a circular plate with diameter 5.21 mm. It is extruded to a thickness of 52.63 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.08653554502370069\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.500029, 84.603577), (136.500029, 172.050023), (127.846474, 172.050023)], [(127.846474, 84.603577), (127.846474, 172.050023)], [(136.500029, 84.603577), (127.846474, 84.603577)], [(136.500029, 61.950023), (136.500029, 70.603577)], [(127.846474, 61.950023), (136.500029, 61.950023)], [(136.500029, 70.603577), (127.846474, 70.603577), (127.846474, 61.950023)], [(128.484105, 69.965947), (128.484105, 62.587653)], [(135.862398, 69.965947), (128.484105, 69.965947)], [(135.862398, 62.587653), (135.862398, 69.965947)], [(128.484105, 62.587653), (135.862398, 62.587653)], [(150.500029, 172.050023), (150.500029, 84.603577)], [(159.153583, 172.050023), (150.500029, 172.050023)], [(159.153583, 84.603577), (159.153583, 172.050023)], [(159.153583, 84.603577), (150.500029, 84.603577)]])\nVISIBLE_CIRCLES = [(135.359006, 171.139122, 0.225328), (134.4529, 171.139122, 0.230122), (129.898397, 171.139122, 0.230122), (128.987497, 171.139122, 0.225328), (135.359006, 85.514478, 0.225328), (134.4529, 85.514478, 0.230122), (129.898397, 85.514478, 0.230122), (128.987497, 85.514478, 0.225328)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(128.4841, 84.6036), (128.4841, 172.05)], [(135.8624, 172.05), (135.8624, 84.6036)], [(129.2128, 69.9659), (129.2128, 70.6036)], [(130.1285, 69.9659), (130.1285, 70.6036)], [(134.683, 69.9659), (134.683, 70.6036)], [(134.683, 62.5876), (134.683, 61.95)], [(130.1285, 62.5876), (130.1285, 61.95)], [(129.2128, 62.5876), (129.2128, 61.95)], [(129.6682, 70.6036), (129.6682, 69.9659)], [(134.2227, 70.6036), (134.2227, 69.9659)], [(135.1336, 70.6036), (135.1336, 69.9659)], [(135.1336, 61.95), (135.1336, 62.5876)], [(134.2227, 61.95), (134.2227, 62.5876)], [(129.6682, 61.95), (129.6682, 62.5876)], [(151.1376, 84.6036), (151.1376, 172.05)], [(158.5159, 172.05), (158.5159, 84.6036)], [(151.1376, 85.7398), (151.1376, 85.5145), (151.1376, 85.2891)], [(151.1376, 85.7398), (151.1376, 85.7446)], [(151.1376, 171.3644), (151.1376, 171.1391), (151.1376, 170.9138)], [(151.1376, 171.3644), (151.1376, 171.3692)], [(150.5, 85.2891), (151.1376, 85.2891)], [(150.5, 85.7398), (151.1376, 85.7398)], [(150.5, 85.2843), (151.1376, 85.2843)], [(150.5, 85.7446), (151.1376, 85.7446)], [(150.5, 170.9138), (151.1376, 170.9138)], [(150.5, 171.3644), (151.1376, 171.3644)], [(150.5, 170.909), (151.1376, 170.909)], [(150.5, 171.3692), (151.1376, 171.3692)], [(159.1536, 85.7398), (158.5159, 85.7398)], [(159.1536, 85.2891), (158.5159, 85.2891)], [(159.1536, 85.7446), (158.5159, 85.7446)], [(159.1536, 85.2843), (158.5159, 85.2843)], [(159.1536, 171.3644), (158.5159, 171.3644)], [(159.1536, 170.9138), (158.5159, 170.9138)], [(159.1536, 171.3692), (158.5159, 171.3692)], [(159.1536, 170.909), (158.5159, 170.909)]])\nDIMENSIONS = [('diameter', '%%c5.2078', (128.9875, 171.1391), 0.2253, 45), ('vertical', '1010.53', (128.9875, 84.6036), (128.9875, 84.6036), (128.9875, 84.6036)), ('diameter', '%%c5.3186', (129.8984, 171.1391), 0.2301, 45), ('horizontal', '13.1856', (127.8464, 84.6036), (129.8984, 84.6036), (128.8724, 95.6036)), ('diameter', '%%c5.3186', (134.4529, 171.1391), 0.2301, 45), ('horizontal', '23.7119', (127.8464, 84.6036), (134.4529, 84.6036), (131.1497, 95.6036)), ('diameter', '%%c5.2078', (135.359, 171.1391), 0.2253, 45), ('horizontal', '76.3435', (127.8464, 84.6036), (135.359, 84.6036), (131.6027, 95.6036)), ('diameter', '%%c5.2078', (135.359, 85.5145), 0.2253, 45), ('horizontal', '86.8144', (127.8464, 84.6036), (135.359, 84.6036), (131.6027, 95.6036)), ('diameter', '%%c5.3186', (134.4529, 85.5145), 0.2301, 45), ('horizontal', '86.8144', (127.8464, 84.6036), (134.4529, 84.6036), (131.1497, 95.6036)), ('diameter', '%%c5.3186', (129.8984, 85.5145), 0.2301, 45), ('horizontal', '76.3435', (127.8464, 84.6036), (129.8984, 84.6036), (128.8724, 95.6036)), ('diameter', '%%c5.2078', (128.9875, 85.5145), 0.2253, 45), ('horizontal', '23.7119', (127.8464, 84.6036), (128.9875, 84.6036), (128.417, 95.6036)), ('vertical', '1010.53', (150.5, 172.05), (150.5, 84.6036), (161.5, 128.3268)), ('horizontal', '7.3684', (150.5, 85.5145), (159.609, 85.5145), (155.0545, 96.5145)), ('horizontal', '100', (136.5, 61.95), (127.8464, 61.95), (132.1732, 50.95)), ('vertical', '100', (136.5, 70.6036), (136.5, 61.95), (147.5, 66.2768)), ('vertical', '7.3684', (128.4841, 69.9659), (128.4841, 62.5876), (139.4841, 66.2768)), ('vertical', '7.3684', (128.4841, 70.6036), (128.4841, 69.9659), (139.4841, 70.2847))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0029_00292321_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0036_00368265","images":["images/0036_00368265.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 39.58 mm. A cut feature: The part is a rectangular plate 20 mm wide and 100 mm tall. It is extruded to a thickness of -19.79 mm. A cut feature: The part is a circular plate with diameter 27.37 mm. It is extruded to a thickness of -133.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6884776119403001\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(145.702303, 172.049981), (145.702303, 103.202219)], [(100.045366, 172.049981), (113.814918, 172.049981), (145.702303, 172.049981)], [(145.702303, 103.202219), (113.814918, 103.202219), (100.045366, 103.202219)], [(113.814918, 172.049981), (113.814918, 103.202219)], [(100.045366, 103.202219), (100.045366, 172.049981)], [(145.702303, 61.949981), (145.702303, 89.202219)], [(145.702303, 61.949981), (100.045366, 61.949981)], [(145.702303, 89.202219), (113.814918, 89.202219), (113.814918, 75.5761), (100.045366, 75.5761)], [(100.045366, 61.949981), (100.045366, 75.5761)], [(159.702303, 172.049981), (173.328422, 172.049981)], [(186.954541, 172.049981), (173.328422, 172.049981)], [(186.954541, 103.202219), (173.328422, 103.202219)], [(159.702303, 103.202219), (173.328422, 103.202219)], [(159.702303, 103.202219), (159.702303, 172.049981)], [(186.954541, 172.049981), (186.954541, 103.202219)], [(173.328422, 103.202219), (173.328422, 172.049981)]])\nVISIBLE_CIRCLES = [(130.2644, 137.6261, 9.421273)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(139.6857, 61.95, 139.6857, 89.2022), (120.8432, 89.2022, 120.8432, 61.95), (159.7023, 128.2048, 186.9546, 128.2048), (159.7023, 147.0474, 186.9546, 147.0474)]\nDIMENSIONS = [('horizontal', '66.3158', (145.7024, 172.05), (100.0454, 172.05), (122.8739, 161.05)), ('vertical', '100', (145.7024, 103.2022), (145.7024, 172.05), (134.7024, 137.6261)), ('horizontal', '20', (100.0454, 103.2022), (113.815, 103.2022), (106.9302, 114.2022)), ('vertical', '100', (113.815, 103.2022), (113.815, 172.05), (102.815, 137.6261)), ('diameter', '%%c27.3684', (130.2644, 137.6261), 9.4213, 45), ('horizontal', '43.8925', (100.0454, 103.2022), (130.2644, 103.2022), (115.1549, 114.2022)), ('vertical', '50', (130.2644, 103.2022), (130.2644, 137.6261), (119.2644, 120.4142)), ('horizontal', '39.5833', (159.7023, 103.2022), (186.9546, 103.2022), (173.3285, 114.2022)), ('horizontal', '19.7917', (186.9546, 103.2022), (173.3284, 103.2022), (180.1415, 92.2022)), ('horizontal', '39.5833', (186.9546, 137.6261), (95.1576, 137.6261), (141.0561, 126.6261))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0036_00368265_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0043_00436331","images":["images/0043_00436331.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 15.63 mm. It is extruded to a thickness of 126.36 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 7.9 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 7.9 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 7.9 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 7.9 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.33225465354926037\nPAGE = [297.0, 210.0]\nC0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 = (175.858951, 91.893237, 75.8889, 138.249308, 129.429225, 81.136757, 126.6239, 158.111043, 81.081516, 95.136757, 152.16994, 126.114789, 141.895188, 124.027592, 129.220208, 115.508594)\nVISIBLE_SEGMENTS = _segments([[(C3, C9), (C3, C6), (C3, C7)], [(C12, C7), (C10, C6), (C12, C9), (C3, C9)], [(C3, C7), (C12, C7)], [(C4, C7), (C4, C6), (C4, C9)], [(C11, C7), (C4, C7)], [(C4, C9), (C11, C9), (C15, C6), (C11, C7)], [(C0, C6), (C0, 126.542765), (C0, 126.461631), (C0, 126.380496), (C0, 126.299361), (C0, 126.218227), (C0, 126.137092), (C0, 126.055958), (C0, 125.974823), (C0, 125.893688), (C0, 125.812554), (C0, 125.731419), (C0, 125.650284), (C0, 125.56915), (C0, 125.488015), (C0, 125.40688), (C0, 125.325746), (C0, 125.244611), (C0, 125.163477), (C0, 125.082342), (C0, 125.001207), (C0, 124.920073), (C0, 124.838938), (C0, 124.757803), (C0, 124.676669), (C0, 124.595534), (C0, 124.5144), (C0, 124.433265), (C0, 124.35213), (C0, 124.270996), (C0, 124.189861), (C0, 124.108726), (C0, C13)], [(C0, C14), (C0, 129.139074), (C0, 129.057939), (C0, 128.976804), (C0, 128.89567), (C0, 128.814535), (C0, 128.7334), (C0, 128.652266), (C0, 128.571131), (C0, 128.489997), (C0, 128.408862), (C0, 128.327727), (C0, 128.246593), (C0, 128.165458), (C0, 128.084323), (C0, 128.003189), (C0, 127.922054), (C0, 127.84092), (C0, 127.759785), (C0, 127.67865), (C0, 127.597516), (C0, 127.516381), (C0, 127.435246), (C0, 127.354112), (C0, 127.272977), (C0, 127.191842), (C0, 127.110708), (C0, 127.029573), (C0, 126.948439), (C0, 126.867304), (C0, 126.786169), (C0, 126.705035), (C0, C6)], [(C1, C6), (C1, 126.542765), (C1, 126.461631), (C1, 126.380496), (C1, 126.299361), (C1, 126.218227), (C1, 126.137092), (C1, 126.055958), (C1, 125.974823), (C1, 125.893688), (C1, 125.812554), (C1, 125.731419), (C1, 125.650284), (C1, 125.56915), (C1, 125.488015), (C1, 125.40688), (C1, 125.325746), (C1, 125.244611), (C1, 125.163477), (C1, 125.082342), (C1, 125.001207), (C1, 124.920073), (C1, 124.838938), (C1, 124.757803), (C1, 124.676669), (C1, 124.595534), (C1, 124.5144), (C1, 124.433265), (C1, 124.35213), (C1, 124.270996), (C1, 124.189861), (C1, 124.108726), (C1, C13)], [(C1, C14), (C1, 129.139074), (C1, 129.057939), (C1, 128.976804), (C1, 128.89567), (C1, 128.814535), (C1, 128.7334), (C1, 128.652266), (C1, 128.571131), (C1, 128.489997), (C1, 128.408862), (C1, 128.327727), (C1, 128.246593), (C1, 128.165458), (C1, 128.084323), (C1, 128.003189), (C1, 127.922054), (C1, 127.84092), (C1, 127.759785), (C1, 127.67865), (C1, 127.597516), (C1, 127.516381), (C1, 127.435246), (C1, 127.354112), (C1, 127.272977), (C1, 127.191842), (C1, 127.110708), (C1, 127.029573), (C1, 126.948439), (C1, 126.867304), (C1, 126.786169), (C1, 126.705035), (C1, C6)], [(C3, C14), (C4, C14)], [(C3, C13), (C4, C13)], [(C0, C14), (151.322723, C14)], [(C0, C13), (151.322723, C13)], [(C1, C13), (116.38314, C13)], [(C1, C14), (116.38314, C14)], [(C4, C2), (C3, C2)], [(C3, C5), (C3, C2)], [(C12, C2), (C10, C2)], [(C3, C2), (C12, C2)], [(C3, C5), (C12, C5), (C12, C2)], [(C12, C5), (C10, C5)], [(C4, C2), (C4, C5)], [(C10, C5), (C10, C8)], [(C10, C2), (152.000036, 75.947566), (151.87226, 76.071045), (151.76675, 76.214559), (151.683907, 76.374078), (151.614351, 76.53917), (151.558591, 76.71005), (151.504497, 76.88137), (151.468393, 77.057454), (151.43229, 77.233538), (151.400728, 77.410346), (151.380337, 77.588933), (151.359945, 77.767519), (151.342536, 77.946331), (151.335932, 78.125957), (151.329328, 78.305582), (151.322723, 78.485208), (151.329328, 78.664834), (151.335932, 78.84446), (151.342536, 79.024086), (151.359945, 79.202897), (151.380337, 79.381484), (151.400728, 79.560071), (151.43229, 79.736878), (151.468393, 79.912962), (151.504497, 80.089046), (151.558591, 80.260367), (151.614351, 80.431246), (151.683907, 80.596339), (151.76675, 80.755857), (151.87226, 80.899372), (152.000036, 81.022851), (C10, C8)], [(C11, C5), (C11, C2)], [(C11, C5), (C4, C5)], [(C11, C2), (C4, C2)], [(C15, C2), (C11, C2)], [(C15, C5), (C11, C5)], [(C10, C2), (C0, C2)], [(C0, C8), (C0, 80.919247), (C0, 80.756978), (C0, 80.594709), (C0, 80.432439), (C0, 80.27017), (C0, 80.107901), (C0, 79.945632), (C0, 79.783362), (C0, 79.621093), (C0, 79.458824), (C0, 79.296555), (C0, 79.134285), (C0, 78.972016), (C0, 78.809747), (C0, 78.647477), (C0, 78.485208), (C0, 78.322939), (C0, 78.16067), (C0, 77.9984), (C0, 77.836131), (C0, 77.673862), (C0, 77.511593), (C0, 77.349323), (C0, 77.187054), (C0, 77.024785), (C0, 76.862516), (C0, 76.700246), (C0, 76.537977), (C0, 76.375708), (C0, 76.213438), (C0, 76.051169), (C0, C2)], [(C15, C5), (C15, C8), (115.679913, 81.024211), (115.811454, 80.903965), (115.921218, 80.762521), (116.00657, 80.603306), (116.079577, 80.438749), (116.137244, 80.267551), (116.194008, 80.096106), (116.231414, 79.919372), (116.26882, 79.742638), (116.302012, 79.565211), (116.323159, 79.385804), (116.344305, 79.206396), (116.362586, 79.026766), (116.369437, 78.846247), (116.376289, 78.665728), (116.38314, 78.485208), (116.376289, 78.304689), (116.369437, 78.12417), (116.362586, 77.94365), (116.344305, 77.76402), (116.323159, 77.584613), (116.302012, 77.405205), (116.26882, 77.227778), (116.231414, 77.051044), (116.194008, 76.87431), (116.137244, 76.702866), (116.079577, 76.531668), (116.00657, 76.36711), (115.921218, 76.207896), (115.811454, 76.066452), (115.679913, 75.946206), (C15, C2), (C1, C2)], [(C1, C8), (C1, 80.919247), (C1, 80.756978), (C1, 80.594709), (C1, 80.432439), (C1, 80.27017), (C1, 80.107901), (C1, 79.945632), (C1, 79.783362), (C1, 79.621093), (C1, 79.458824), (C1, 79.296555), (C1, 79.134285), (C1, 78.972016), (C1, 78.809747), (C1, 78.647477), (C1, 78.485208), (C1, 78.322939), (C1, 78.16067), (C1, 77.9984), (C1, 77.836131), (C1, 77.673862), (C1, 77.511593), (C1, 77.349323), (C1, 77.187054), (C1, 77.024785), (C1, 76.862516), (C1, 76.700246), (C1, 76.537977), (C1, 76.375708), (C1, 76.213438), (C1, 76.051169), (C1, C2)], [(C3, C8), (C4, C8)], [(C0, C8), (C10, C8)], [(C1, C8), (C15, C8)], [(189.858951, C7), (195.106808, C7)], [(195.106808, C9), (195.106808, C6), (195.106808, C7)], [(189.858951, C9), (189.858951, C6), (189.858951, C7)], [(195.106808, C9), (189.858951, C9)], [(189.858951, C6), (189.914192, C6)]])\nVISIBLE_CIRCLES = [(192.5105, 126.6239, 2.596308)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '41.8975', (115.5086, 126.6239), (129.4292, 126.6239), (122.4689, 137.6239)), ('vertical', '94.7681', (129.4292, 126.6239), (129.4292, 95.1368), (140.4292, 110.8804)), ('aligned', '100', (126.1148, 95.1368), (115.5086, 126.6239), (110.3872, 107.3689)), ('horizontal', '41.8975', (138.2493, 126.6239), (152.1699, 126.6239), (145.2096, 137.6239)), ('vertical', '94.7681', (152.1699, 126.6239), (152.1699, 95.1368), (163.1699, 110.8804)), ('aligned', '99.686', (152.1699, 126.6239), (141.8952, 95.1368), (157.4899, 107.468)), ('horizontal', '41.8975', (138.2493, 158.1111), (152.1699, 158.1111), (145.2096, 169.1111)), ('vertical', '94.7681', (152.1699, 158.1111), (152.1699, 126.6239), (163.1699, 142.3675)), ('aligned', '99.686', (141.8952, 158.1111), (152.1699, 126.6239), (157.4899, 145.7799)), ('horizontal', '41.8975', (115.5086, 158.1111), (129.4292, 158.1111), (122.4689, 169.1111)), ('vertical', '94.7681', (129.4292, 158.1111), (129.4292, 126.6239), (140.4292, 142.3675)), ('aligned', '100', (115.5086, 126.6239), (126.1148, 158.1111), (110.3872, 145.8789)), ('diameter', '%%c15.6284', (192.5105, 126.6239), 2.5963, 45), ('horizontal', '15.7947', (195.1068, 126.6239), (189.8589, 126.6239), (192.4829, 115.6239)), ('horizontal', '15.7947', (195.1068, 158.1111), (189.8589, 158.1111), (192.4829, 147.1111)), ('horizontal', '15.7947', (195.1068, 158.1111), (189.8589, 158.1111), (192.4829, 147.1111)), ('horizontal', '252.715', (91.8932, 78.4852), (175.8589, 78.4852), (133.8761, 89.4852))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0043_00436331_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0046_00463799","images":["images/0046_00463799.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a square plate 100 x 100 mm. It is extruded to a thickness of 100 mm. A cut feature: The part is a square plate 75 x 75 mm. It is extruded to a thickness of -100 mm. A cut feature: The part is a circular plate with diameter 25.26 mm. It is extruded to a thickness of -25 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4805000000000168\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(136.499976, 124.00005), (136.499976, 160.03755), (136.499976, 172.05005), (88.449976, 172.05005)], [(136.499976, 160.03755), (88.449976, 160.03755)], [(88.449976, 172.05005), (88.449976, 160.03755)], [(136.499976, 124.00005), (88.449976, 124.00005), (88.449976, 160.03755)], [(136.499976, 110.00005), (136.499976, 61.95005)], [(136.499976, 110.00005), (88.449976, 110.00005)], [(136.499976, 61.95005), (88.449976, 61.95005)], [(88.449976, 110.00005), (88.449976, 61.95005)], [(150.499976, 172.05005), (150.499976, 124.00005)], [(150.499976, 172.05005), (198.549976, 172.05005), (198.549976, 160.03755)], [(162.512476, 160.03755), (198.549976, 160.03755)], [(162.512476, 124.00005), (162.512476, 160.03755)], [(150.499976, 124.00005), (162.512476, 124.00005)]])\nVISIBLE_CIRCLES = [(112.5382, 79.9688, 6.069474)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(118.6077, 160.0375, 118.6077, 172.05), (106.4687, 172.05, 106.4687, 160.0375), (136.5, 97.9875, 88.45, 97.9875), (174.4618, 172.05, 174.4618, 160.0375), (186.6007, 172.05, 186.6007, 160.0375)]\nDIMENSIONS = [('horizontal', '100', (136.5, 172.05), (88.45, 172.05), (112.475, 161.05)), ('vertical', '100', (136.5, 124.0), (136.5, 172.05), (125.5, 148.025)), ('vertical', '25', (162.5125, 124.0), (162.5125, 160.0375), (151.5125, 142.0187)), ('vertical', '75', (180.5313, 160.0375), (180.5313, 172.05), (169.5313, 166.0437)), ('horizontal', '100', (136.5, 97.9875), (88.45, 97.9875), (112.475, 86.9875)), ('diameter', '%%c25.2632', (112.5382, 79.9688), 6.0695, 45), ('horizontal', '100', (88.45, 110.0), (112.5382, 110.0), (100.4941, 121.0))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0046_00463799_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0054_00546787","images":["images/0054_00546787.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 27.97 mm. A union feature: The part is a circular plate with diameter 83.02 mm. It is extruded to a thickness of 22.59 mm. A union feature: The part is a rectangular plate 51.97 mm wide and 58.08 mm tall. It is extruded to a thickness of 52.71 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.4727914438502846\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(121.412099, 167.095666), (121.412099, 139.633934), (96.841077, 139.633934), (96.841077, 167.095666), (121.412099, 167.095666)], [(132.932108, 66.904372), (131.454635, 66.904372), (129.977162, 66.904372), (128.499688, 66.904372), (127.022215, 66.904372), (125.544742, 66.904372), (124.067269, 66.904372), (122.589795, 66.904372), (121.112322, 66.904372), (119.634849, 66.904372), (118.157376, 66.904372), (116.679902, 66.904372), (115.202429, 66.904372), (113.724956, 66.904372), (112.247483, 66.904372), (110.770009, 66.904372), (109.292536, 66.904372), (107.815063, 66.904372), (106.33759, 66.904372), (104.860116, 66.904372), (103.382643, 66.904372), (101.90517, 66.904372), (100.427697, 66.904372), (98.950223, 66.904372), (97.47275, 66.904372), (95.995277, 66.904372), (94.517803, 66.904372), (93.04033, 66.904372), (91.562857, 66.904372), (90.085384, 66.904372), (88.60791, 66.904372), (87.130437, 66.904372), (85.652964, 66.904372)], [(132.932108, 66.904372), (132.932108, 80.126687), (131.454635, 80.126687), (129.977162, 80.126687), (128.499688, 80.126687), (127.022215, 80.126687), (125.544742, 80.126687), (124.067269, 80.126687), (122.589795, 80.126687), (121.112322, 80.126687), (119.634849, 80.126687), (118.157376, 80.126687), (116.679902, 80.126687), (115.202429, 80.126687), (113.724956, 80.126687), (112.247483, 80.126687), (110.770009, 80.126687), (109.292536, 80.126687), (107.815063, 80.126687), (106.33759, 80.126687), (104.860116, 80.126687), (103.382643, 80.126687), (101.90517, 80.126687), (100.427697, 80.126687), (98.950223, 80.126687), (97.47275, 80.126687), (95.995277, 80.126687), (94.517803, 80.126687), (93.04033, 80.126687), (91.562857, 80.126687), (90.085384, 80.126687), (88.60791, 80.126687), (87.130437, 80.126687), (85.652964, 80.126687)], [(128.879763, 80.126687), (128.879763, 90.806249), (127.653219, 90.806249), (126.426676, 90.806249), (125.200132, 90.806249), (123.973588, 90.806249), (122.747045, 90.806249), (121.520501, 90.806249), (120.293957, 90.806249), (119.067414, 90.806249), (117.84087, 90.806249), (116.614326, 90.806249), (115.387782, 90.806249), (114.161239, 90.806249), (112.934695, 90.806249), (111.708151, 90.806249), (110.481608, 90.806249), (109.255064, 90.806249), (108.02852, 90.806249), (106.801977, 90.806249), (105.575433, 90.806249), (104.348889, 90.806249), (103.122345, 90.806249), (101.895802, 90.806249), (100.669258, 90.806249), (99.442714, 90.806249), (98.216171, 90.806249), (96.989627, 90.806249), (95.763083, 90.806249), (94.53654, 90.806249), (93.309996, 90.806249), (92.083452, 90.806249), (90.856908, 90.806249), (89.630365, 90.806249)], [(121.412099, 90.806249), (121.412099, 115.725228), (96.841077, 115.725228)], [(96.841077, 90.806249), (96.841077, 115.725228)], [(85.652964, 80.126687), (85.652964, 66.904372)], [(89.630365, 90.806249), (89.630365, 80.126687)], [(146.932108, 129.725228), (146.932108, 131.202701), (146.932108, 132.680174), (146.932108, 134.157648), (146.932108, 135.635121), (146.932108, 137.112594), (146.932108, 138.590067), (146.932108, 140.067541), (146.932108, 141.545014), (146.932108, 143.022487), (146.932108, 144.49996), (146.932108, 145.977434), (146.932108, 147.454907), (146.932108, 148.93238), (146.932108, 150.409853), (146.932108, 151.887327), (146.932108, 153.3648), (146.932108, 154.842273), (146.932108, 156.319747), (146.932108, 157.79722), (146.932108, 159.274693), (146.932108, 160.752166), (146.932108, 162.22964), (146.932108, 163.707113), (146.932108, 165.184586), (146.932108, 166.662059), (146.932108, 168.139533), (146.932108, 169.617006), (146.932108, 171.094479), (146.932108, 172.571952), (146.932108, 174.049426), (146.932108, 175.526899), (146.932108, 177.004372)], [(160.154423, 129.725228), (160.154423, 131.202701), (160.154423, 132.680174), (160.154423, 134.157648), (160.154423, 135.635121), (160.154423, 137.112594), (160.154423, 138.590067), (160.154423, 140.067541), (160.154423, 141.545014), (160.154423, 143.022487), (160.154423, 144.49996), (160.154423, 145.977434), (160.154423, 147.454907), (160.154423, 148.93238), (160.154423, 150.409853), (160.154423, 151.887327), (160.154423, 153.3648), (160.154423, 154.842273), (160.154423, 156.319747), (160.154423, 157.79722), (160.154423, 159.274693), (160.154423, 160.752166), (160.154423, 162.22964), (160.154423, 163.707113), (160.154423, 165.184586), (160.154423, 166.662059), (160.154423, 168.139533), (160.154423, 169.617006), (160.154423, 171.094479), (160.154423, 172.571952), (160.154423, 174.049426), (160.154423, 175.526899), (160.154423, 177.004372)], [(170.833986, 133.740101), (170.833986, 134.966645), (170.833986, 136.193188), (170.833986, 137.419732), (170.833986, 138.646276), (170.833986, 139.872819), (170.833986, 141.099363), (170.833986, 142.325907), (170.833986, 143.55245), (170.833986, 144.778994), (170.833986, 146.005538), (170.833986, 147.232082), (170.833986, 148.458625), (170.833986, 149.685169), (170.833986, 150.911713), (170.833986, 152.138256), (170.833986, 153.3648), (170.833986, 154.591344), (170.833986, 155.817887), (170.833986, 157.044431), (170.833986, 158.270975), (170.833986, 159.497518), (170.833986, 160.724062), (170.833986, 161.950606), (170.833986, 163.17715), (170.833986, 164.403693), (170.833986, 165.630237), (170.833986, 166.856781), (170.833986, 168.083324), (170.833986, 169.309868), (170.833986, 170.536412), (170.833986, 171.762955), (170.833986, 172.989499)], [(170.833986, 139.633934), (195.752964, 139.633934), (195.752964, 167.095666)], [(170.833986, 167.095666), (195.752964, 167.095666)], [(160.154423, 129.725228), (146.932108, 129.725228)], [(160.154423, 177.004372), (146.932108, 177.004372)], [(170.833986, 133.740101), (160.154423, 133.740101)], [(170.833986, 172.989499), (160.154423, 172.989499)]])\nVISIBLE_CIRCLES = [(109.292536, 153.3648, 23.639572), (109.255064, 153.3648, 19.624699)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('diameter', '%%c100', (109.2925, 153.3648), 23.6396, 45), ('diameter', '%%c83.0163', (109.2551, 153.3648), 19.6247, 135), ('horizontal', '51.9701', (96.8411, 139.6339), (121.4121, 139.6339), (109.1266, 150.6339)), ('vertical', '58.0842', (121.4121, 139.6339), (121.4121, 167.0956), (110.4121, 153.3648)), ('horizontal', '27.9665', (146.9321, 153.3648), (160.1544, 153.3648), (153.5433, 164.3648)), ('horizontal', '50.5548', (160.1544, 153.3648), (170.834, 153.3648), (165.4942, 164.3648)), ('horizontal', '52.7061', (170.834, 139.6339), (195.753, 139.6339), (183.2935, 150.6339))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0054_00546787_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0058_00582355","images":["images/0058_00582355.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 86.32 mm tall, featuring 4 circular holes, each of diameter 6.32 mm. It is extruded to a thickness of 3.24 mm. A union feature: The part is a square plate 15.68 x 15.35 mm. It is extruded to a thickness of 7.57 mm. A union feature: The part is a rectangular plate 1.91 mm wide and 15.14 mm tall. It is extruded to a thickness of 7.57 mm. A union feature: The part is a rectangular plate 15.14 mm wide and 9.4 mm tall. It is extruded to a thickness of 16.76 mm. A union feature: The part is a rectangular plate 6.15 mm wide and 10.81 mm tall. It is extruded to a thickness of 16.22 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7843171893582755\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(162.363259, 104.351071), (162.363259, 172.050029)], [(83.931541, 104.351071), (126.327064, 104.351071), (131.146766, 104.351071), (162.363259, 104.351071)], [(162.363259, 172.050029), (83.931541, 172.050029), (83.931541, 104.351071)], [(83.931541, 132.366606), (82.672616, 132.335692)], [(82.526955, 132.335692), (82.672616, 132.335692)], [(83.931541, 132.370183), (82.526955, 132.335692)], [(83.734279, 144.239662), (83.931541, 136.201707)], [(83.734279, 144.239662), (83.879941, 144.239662), (83.931541, 142.13708)], [(131.146766, 104.351071), (131.146766, 112.830176), (126.327064, 112.830176), (126.327064, 104.351071)], [(82.23572, 144.202864), (83.734279, 144.239662)], [(82.526955, 132.335692), (82.23572, 144.202864)], [(162.363259, 77.212417), (162.363259, 74.668686), (83.931541, 74.668686)], [(83.931541, 77.212417), (83.931541, 74.668686)], [(162.363259, 77.212417), (83.931541, 77.212417)], [(83.734279, 77.17563), (83.931541, 77.170787)], [(83.734279, 77.17563), (83.879941, 83.109215), (84.076181, 83.104398)], [(83.931541, 77.212417), (84.077202, 83.146003)], [(96.521706, 77.212417), (96.659785, 82.837118)], [(96.226242, 77.212417), (96.364499, 82.844367), (96.659785, 82.837118)], [(84.077202, 83.146003), (96.364499, 82.844367)], [(100.88975, 77.212417), (101.212286, 90.351071), (113.075883, 90.059836)], [(112.760497, 77.212417), (113.075883, 90.059836)], [(112.941478, 77.212417), (113.256755, 90.055396)], [(113.075883, 90.059836), (113.256755, 90.055396)], [(131.146766, 74.668686), (131.146766, 61.950029), (126.327064, 61.950029)], [(126.327064, 74.668686), (126.327064, 61.950029)], [(82.23572, 77.212417), (83.734279, 77.17563)], [(82.23572, 77.212417), (82.381381, 83.146003), (83.879941, 83.109215)], [(189.501914, 104.351071), (192.045645, 104.351071), (204.764302, 104.351071)], [(189.501914, 172.050029), (192.045645, 172.050029)], [(189.501914, 132.335692), (189.501914, 104.351071)], [(189.501914, 172.050029), (189.501914, 144.239662)], [(192.045645, 172.050029), (192.045645, 104.351071)], [(189.543544, 132.370183), (189.543544, 136.201707)], [(189.509063, 132.335692), (183.575477, 132.335692)], [(189.543544, 132.370183), (189.509063, 132.335692)], [(189.538701, 144.239662), (189.543544, 136.201707)], [(189.538701, 144.239662), (183.605115, 144.239662)], [(189.501914, 132.170623), (183.575577, 132.170623), (183.575477, 132.335692)], [(189.501914, 144.504591), (183.869964, 144.504591)], [(183.605115, 144.239662), (183.869964, 144.504591)], [(189.501914, 167.096446), (176.363259, 167.096446), (176.654494, 167.387769)], [(189.501914, 167.387769), (176.654494, 167.387769)], [(189.501914, 159.726308), (176.3677, 159.726308), (176.363259, 167.096446)], [(192.045645, 112.830176), (204.764302, 112.830176), (204.764302, 104.351071)], [(189.501914, 144.202864), (189.538701, 144.239662)], [(189.509063, 132.335692), (189.501914, 144.202864)], [(183.575477, 132.335692), (183.568328, 144.202864)], [(189.501914, 144.202864), (183.568328, 144.202864), (183.605115, 144.239662)]])\nVISIBLE_CIRCLES = [(88.885123, 109.304654, 2.476791), (157.409677, 109.304654, 2.476791), (88.885123, 167.096446, 2.476791), (157.409677, 167.096446, 2.476791)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(96.2262, 144.5046), (96.5217, 132.4723)], [(100.8897, 167.0964), (112.7605, 167.3877), (112.9415, 160.0176), (101.0707, 159.7263), (100.8897, 167.0964)], [(96.5217, 132.4723), (96.6598, 132.4723)], [(96.2262, 144.5046), (96.3645, 144.5046), (96.6598, 132.4723)], [(100.8897, 167.0964), (101.2123, 167.0964), (113.0759, 167.3877)], [(112.7605, 167.3877), (113.0759, 167.3877)], [(101.0707, 159.7263), (101.3931, 159.7263), (101.2123, 167.0964)], [(112.9415, 160.0176), (113.2567, 160.0176), (101.3931, 159.7263)], [(113.0759, 167.3877), (113.2567, 160.0176)], [(91.3619, 77.2124), (91.3619, 74.6687)], [(159.8865, 77.2124), (159.8865, 74.6687)], [(86.4083, 74.6687), (86.4083, 77.2124)], [(154.9329, 74.6687), (154.9329, 77.2124)], [(192.0456, 111.7814), (189.5019, 111.7814)], [(192.0456, 106.8278), (189.5019, 106.8278)], [(192.0456, 169.5732), (189.5019, 169.5732)], [(192.0456, 164.6196), (189.5019, 164.6196)]])\nDIMENSIONS = [('horizontal', '100', (162.3633, 172.05), (83.9316, 172.05), (123.1474, 161.05)), ('vertical', '86.3158', (162.3633, 104.3511), (162.3633, 172.05), (151.3633, 138.2005)), ('diameter', '%%c6.3158', (88.8851, 109.3046), 2.4768, 45), ('horizontal', '0.1212', (83.9316, 109.3046), (88.8851, 109.3046), (86.4083, 120.3046)), ('vertical', '10.1484', (88.8851, 104.3511), (88.8851, 109.3046), (77.8851, 106.8278)), ('diameter', '%%c6.3158', (88.8851, 167.0965), 2.4768, 45), ('horizontal', '15.299', (83.9316, 167.0965), (88.8851, 167.0965), (86.4083, 178.0965)), ('vertical', '44.1455', (88.8851, 104.3511), (88.8851, 167.0965), (77.8851, 135.7238)), ('diameter', '%%c6.3158', (157.4097, 109.3046), 2.4768, 45), ('horizontal', '0.2308', (83.9316, 109.3046), (157.4097, 109.3046), (120.6706, 120.3046)), ('vertical', '34.876', (157.4097, 104.3511), (157.4097, 109.3046), (146.4097, 106.8278)), ('diameter', '%%c6.3158', (157.4097, 167.0965), 2.4768, 45), ('horizontal', '0.3765', (83.9316, 167.0965), (157.4097, 167.0965), (120.6706, 178.0965)), ('vertical', '15.341', (157.4097, 104.3511), (157.4097, 167.0965), (146.4097, 135.7238)), ('horizontal', '15.126', (83.9316, 144.2029), (96.2188, 144.5046), (89.8052, 155.3504)), ('vertical', '0.3714', (96.2188, 144.5046), (96.5141, 132.4723), (107.3632, 138.7583)), ('vertical', '44.4951', (83.9316, 104.3511), (83.9316, 104.3511), (83.9316, 104.3511)), ('vertical', '6.3157', (83.9316, 104.3511), (83.9316, 144.2029), (72.9316, 124.277)), ('horizontal', '6.3158', (82.2357, 144.2029), (83.7343, 144.2396), (82.7151, 155.2179)), ('vertical', '80', (83.7343, 144.2396), (84.0255, 132.3725), (94.8766, 138.5759)), ('horizontal', '6.3158', (83.9316, 104.3511), (82.2357, 104.3511), (83.0836, 93.3511)), ('vertical', '6.3157', (82.2357, 104.3511), (82.2357, 144.2029), (71.2357, 124.277)), ('horizontal', '93.6842', (100.8897, 167.0965), (112.7533, 167.3877), (106.5515, 178.2388)), ('vertical', '80', (112.7533, 167.3877), (112.9342, 160.0176), (123.8404, 163.9725)), ('horizontal', '93.6842', (83.9316, 104.3511), (100.8897, 104.3511), (92.4106, 115.3511)), ('horizontal', '16.0427', (126.327, 104.3511), (131.1467, 104.3511), (128.7369, 115.3511)), ('horizontal', '2.1622', (83.9316, 104.3511), (126.327, 104.3511), (105.1293, 115.3511)), ('vertical', '0', (126.327, 104.3511), (126.327, 104.3511), (126.327, 104.3511)), ('horizontal', '3.2432', (189.5019, 104.3511), (192.0456, 104.3511), (190.7738, 115.3511)), ('horizontal', '7.5676', (189.5387, 144.2396), (183.6051, 144.2396), (186.5719, 133.2396)), ('horizontal', '16.2162', (192.0456, 104.3511), (204.7642, 104.3511), (198.4049, 115.3511))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0058_00582355_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00662186","images":["images/0066_00662186.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 66.32 mm wide and 100 mm tall. It is extruded to a thickness of 39.58 mm. A cut feature: The part is a rectangular plate 20 mm wide and 100 mm tall. It is extruded to a thickness of -19.79 mm. A cut feature: The part is a circular plate with diameter 27.37 mm. It is extruded to a thickness of -133.33 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.6884776119403001\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(145.702303, 172.049981), (145.702303, 103.202219)], [(100.045366, 172.049981), (113.814918, 172.049981), (145.702303, 172.049981)], [(145.702303, 103.202219), (113.814918, 103.202219), (100.045366, 103.202219)], [(113.814918, 172.049981), (113.814918, 103.202219)], [(100.045366, 103.202219), (100.045366, 172.049981)], [(145.702303, 61.949981), (145.702303, 89.202219)], [(145.702303, 61.949981), (100.045366, 61.949981)], [(145.702303, 89.202219), (113.814918, 89.202219), (113.814918, 75.5761), (100.045366, 75.5761)], [(100.045366, 61.949981), (100.045366, 75.5761)], [(159.702303, 172.049981), (173.328422, 172.049981)], [(186.954541, 172.049981), (173.328422, 172.049981)], [(186.954541, 103.202219), (173.328422, 103.202219)], [(159.702303, 103.202219), (173.328422, 103.202219)], [(159.702303, 103.202219), (159.702303, 172.049981)], [(186.954541, 172.049981), (186.954541, 103.202219)], [(173.328422, 103.202219), (173.328422, 172.049981)]])\nVISIBLE_CIRCLES = [(130.2644, 137.6261, 9.421273)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(139.6857, 61.95, 139.6857, 89.2022), (120.8432, 89.2022, 120.8432, 61.95), (159.7023, 128.2048, 186.9546, 128.2048), (159.7023, 147.0474, 186.9546, 147.0474)]\nDIMENSIONS = [('horizontal', '66.3158', (145.7024, 172.05), (100.0454, 172.05), (122.8739, 161.05)), ('vertical', '100', (145.7024, 103.2022), (145.7024, 172.05), (134.7024, 137.6261)), ('horizontal', '20', (100.0454, 103.2022), (113.815, 103.2022), (106.9302, 114.2022)), ('vertical', '100', (113.815, 103.2022), (113.815, 172.05), (102.815, 137.6261)), ('diameter', '%%c27.3684', (130.2644, 137.6261), 9.4213, 45), ('horizontal', '43.8925', (100.0454, 103.2022), (130.2644, 103.2022), (115.1549, 114.2022)), ('vertical', '50', (130.2644, 103.2022), (130.2644, 137.6261), (119.2644, 120.4142)), ('horizontal', '39.5833', (159.7023, 103.2022), (186.9546, 103.2022), (173.3285, 114.2022)), ('horizontal', '19.7917', (186.9546, 103.2022), (173.3284, 103.2022), (180.1415, 92.2022)), ('horizontal', '39.5833', (186.9546, 137.6261), (95.1576, 137.6261), (141.0561, 126.6261))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00662186_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0066_00668751","images":["images/0066_00668751.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 56.84 mm wide and 100 mm tall. It is extruded to a thickness of 5.21 mm. A cut feature: The part is a circular plate with diameter 6.32 mm. It is extruded to a thickness of -20.83 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.9134257425742603\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(160.081778, 80.707428), (160.081778, 172.050002)], [(108.160736, 80.707428), (160.081778, 80.707428)], [(160.081778, 172.050002), (108.160736, 172.050002), (108.160736, 80.707428)], [(160.081778, 66.707428), (160.081778, 61.950002), (108.160736, 61.950002)], [(108.160736, 66.707428), (108.160736, 61.950002)], [(160.081778, 66.707428), (108.160736, 66.707428)], [(174.081778, 80.707428), (178.839204, 80.707428)], [(174.081778, 172.050002), (178.839204, 172.050002)], [(174.081778, 172.050002), (174.081778, 80.707428)], [(178.839204, 172.050002), (178.839204, 80.707428)]])\nVISIBLE_CIRCLES = [(113.8396, 127.3302, 2.884502)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(116.7241, 61.95, 116.7241, 66.7074), (110.9551, 66.7074, 110.9551, 61.95), (174.0818, 124.4457, 178.8392, 124.4457), (174.0818, 130.2147, 178.8392, 130.2147)]\nDIMENSIONS = [('horizontal', '56.8421', (160.0818, 172.05), (108.1607, 172.05), (134.1213, 161.05)), ('vertical', '100', (160.0818, 80.7074), (160.0818, 172.05), (149.0818, 126.3787)), ('diameter', '%%c6.3158', (113.8396, 127.3302), 2.8845, 45), ('horizontal', '6.2171', (108.1607, 80.7074), (113.8396, 80.7074), (111.0002, 91.7074)), ('vertical', '51.0417', (113.8396, 80.7074), (113.8396, 127.3302), (102.8396, 104.0188)), ('horizontal', '5.2083', (174.0818, 80.7074), (178.8392, 80.7074), (176.4605, 91.7074)), ('horizontal', '5.2083', (178.8392, 127.3302), (159.8095, 127.3302), (169.3244, 116.3302))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0066_00668751_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0070_00708311","images":["images/0070_00708311.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a polygonal plate with 6 straight edges. It is extruded to a thickness of 41.13 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a circular plate with diameter 100 mm. It is extruded to a thickness of 20.56 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.577115281501345\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(101.361344, 172.049966), (136.037447, 172.049966)], [(83.654398, 141.8006), (101.361344, 172.049966)], [(136.037447, 172.049966), (153.744393, 141.8006), (136.037447, 111.551234), (101.361344, 111.551234), (83.654398, 141.8006)], [(83.654398, 61.949966), (83.654398, 85.684145)], [(153.744393, 61.949966), (153.744393, 85.684145)], [(153.744393, 61.949966), (136.037447, 61.949966), (101.361344, 61.949966), (83.654398, 61.949966)], [(153.744393, 85.684145), (136.037447, 85.684145), (101.361344, 85.684145), (83.654398, 85.684145)], [(101.361344, 61.949966), (101.361344, 85.684145)], [(136.037447, 61.949966), (136.037447, 85.684145)], [(148.041164, 85.684145), (148.041164, 97.551234), (146.237679, 97.551234), (144.434194, 97.551234), (142.630708, 97.551234), (140.827223, 97.551234), (139.023738, 97.551234), (137.220253, 97.551234), (135.416767, 97.551234), (133.613282, 97.551234), (131.809797, 97.551234), (130.006312, 97.551234), (128.202826, 97.551234), (126.399341, 97.551234), (124.595856, 97.551234), (122.792371, 97.551234), (120.988885, 97.551234), (119.1854, 97.551234), (117.381915, 97.551234), (115.578429, 97.551234), (113.774944, 97.551234), (111.971459, 97.551234), (110.167974, 97.551234), (108.364488, 97.551234), (106.561003, 97.551234), (104.757518, 97.551234), (102.954033, 97.551234), (101.150547, 97.551234), (99.347062, 97.551234), (97.543577, 97.551234), (95.740092, 97.551234), (93.936606, 97.551234), (92.133121, 97.551234), (90.329636, 97.551234), (90.329636, 85.684145)], [(167.744393, 172.049966), (191.478572, 172.049966)], [(167.744393, 141.8006), (191.478572, 141.8006), (191.478572, 172.049966)], [(167.744393, 141.8006), (167.744393, 172.049966)], [(167.744393, 111.551234), (167.744393, 141.8006)], [(191.478572, 111.551234), (191.478572, 141.8006)], [(167.744393, 111.551234), (191.478572, 111.551234)], [(203.345661, 112.944836), (203.345661, 114.748321), (203.345661, 116.551806), (203.345661, 118.355292), (203.345661, 120.158777), (203.345661, 121.962262), (203.345661, 123.765747), (203.345661, 125.569233), (203.345661, 127.372718), (203.345661, 129.176203), (203.345661, 130.979688), (203.345661, 132.783174), (203.345661, 134.586659), (203.345661, 136.390144), (203.345661, 138.193629), (203.345661, 139.997115), (203.345661, 141.8006), (203.345661, 143.604085), (203.345661, 145.407571), (203.345661, 147.211056), (203.345661, 149.014541), (203.345661, 150.818026), (203.345661, 152.621512), (203.345661, 154.424997), (203.345661, 156.228482), (203.345661, 158.031967), (203.345661, 159.835453), (203.345661, 161.638938), (203.345661, 163.442423), (203.345661, 165.245908), (203.345661, 167.049394), (203.345661, 168.852879), (203.345661, 170.656364)], [(203.345661, 112.944836), (191.478572, 112.944836)], [(203.345661, 170.656364), (191.478572, 170.656364)]])\nVISIBLE_CIRCLES = [(119.1854, 141.8006, 28.855764)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = []\nDIMENSIONS = [('horizontal', '60.0852', (101.3613, 111.5513), (136.0374, 111.5513), (118.6994, 122.5513)), ('aligned', '60.7345', (136.0374, 111.5513), (153.7443, 141.8006), (135.3977, 132.2329)), ('aligned', '60.7345', (153.7443, 141.8006), (136.0374, 172.05), (135.3977, 151.3684)), ('aligned', '60.7345', (101.3613, 172.05), (83.6544, 141.8006), (102.001, 151.3684)), ('aligned', '60.7345', (83.6544, 141.8006), (101.3613, 111.5513), (102.001, 132.2329)), ('diameter', '%%c100', (119.1854, 141.8006), 28.8558, 45), ('horizontal', '41.1255', (167.7444, 111.5513), (191.4785, 111.5513), (179.6114, 122.5513)), ('horizontal', '20.5628', (191.4785, 141.8006), (203.3456, 141.8006), (197.4121, 152.8006))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0070_00708311_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0080_00808827","images":["images/0080_00808827.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a circular plate with diameter 100 mm, featuring a circular hole of diameter 25 mm. It is extruded to a thickness of 9.79 mm. A cut feature: The part is a rectangular plate 32.99 mm wide and 9.72 mm tall. It is extruded to a thickness of -65.97 mm. A cut feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -65.97 mm. The outline includes one or more oblique (angled) edges. A cut feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of -65.97 mm. The outline includes one or more oblique (angled) edges.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7347\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(119.017327, 155.892983), (125.155771, 152.3853)], [(106.959669, 135.066119), (119.017327, 155.892983)], [(113.098113, 131.558437), (106.959669, 135.066119)], [(125.155771, 152.3853), (113.098113, 131.558437)], [(141.039992, 125.599363), (141.039992, 118.456446)], [(116.805096, 125.599363), (141.039992, 125.599363)], [(116.805096, 118.456446), (116.805096, 125.599363)], [(141.039992, 118.456446), (116.805096, 118.456446)], [(138.46902, 155.992633), (150.526678, 135.165769)], [(132.330576, 152.48495), (138.46902, 155.992633)], [(144.388234, 131.658087), (132.330576, 152.48495)], [(150.526678, 135.165769), (144.388234, 131.658087)], [(92.5702, 78.651065), (94.866138, 78.651065), (97.162075, 78.651065), (99.458013, 78.651065), (101.75395, 78.651065), (104.049888, 78.651065), (106.345825, 78.651065), (108.641763, 78.651065), (110.9377, 78.651065), (113.233638, 78.651065), (115.529575, 78.651065), (117.825513, 78.651065), (120.12145, 78.651065), (122.417388, 78.651065), (124.713325, 78.651065), (127.009263, 78.651065), (129.3052, 78.651065), (131.601137, 78.651065), (133.897075, 78.651065), (136.193013, 78.651065), (138.48895, 78.651065), (140.784888, 78.651065), (143.080825, 78.651065), (145.376763, 78.651065), (147.6727, 78.651065), (149.968638, 78.651065), (152.264575, 78.651065), (154.560513, 78.651065), (156.85645, 78.651065), (159.152388, 78.651065), (161.448325, 78.651065), (163.744263, 78.651065), (166.0402, 78.651065), (166.0402, 85.8458)], [(92.5702, 85.8458), (94.866138, 85.8458), (97.162075, 85.8458), (99.458013, 85.8458), (101.75395, 85.8458), (104.049888, 85.8458), (106.345825, 85.8458), (108.641763, 85.8458), (110.9377, 85.8458), (113.233638, 85.8458), (115.529575, 85.8458), (117.825513, 85.8458), (120.12145, 85.8458), (122.417388, 85.8458), (124.713325, 85.8458), (127.009263, 85.8458), (129.3052, 85.8458), (131.601137, 85.8458), (133.897075, 85.8458), (136.193013, 85.8458), (138.48895, 85.8458), (140.784888, 85.8458), (143.080825, 85.8458), (145.376763, 85.8458), (147.6727, 85.8458), (149.968638, 85.8458), (152.264575, 85.8458), (154.560513, 85.8458), (156.85645, 85.8458), (159.152388, 85.8458), (161.448325, 85.8458), (163.744263, 85.8458), (166.0402, 85.8458)], [(92.5702, 85.8458), (92.5702, 78.651065)], [(187.234935, 99.8458), (187.234935, 102.141738), (187.234935, 104.437675), (187.234935, 106.733613), (187.234935, 109.02955), (187.234935, 111.325488), (187.234935, 113.621425), (187.234935, 115.917362), (187.234935, 118.2133), (187.234935, 120.509237), (187.234935, 122.805175), (187.234935, 125.101112), (187.234935, 127.39705), (187.234935, 129.692987), (187.234935, 131.988925), (187.234935, 134.284862), (187.234935, 136.5808), (187.234935, 138.876738), (187.234935, 141.172675), (187.234935, 143.468613), (187.234935, 145.76455), (187.234935, 148.060487), (187.234935, 150.356425), (187.234935, 152.652362), (187.234935, 154.9483), (187.234935, 157.244237), (187.234935, 159.540175), (187.234935, 161.836112), (187.234935, 164.13205), (187.234935, 166.427987), (187.234935, 168.723925), (187.234935, 171.019862), (187.234935, 173.3158)], [(180.0402, 99.8458), (180.0402, 102.141738), (180.0402, 104.437675), (180.0402, 106.733613), (180.0402, 109.02955), (180.0402, 111.325488), (180.0402, 113.621425), (180.0402, 115.917362), (180.0402, 118.2133), (180.0402, 120.509237), (180.0402, 122.805175), (180.0402, 125.101112), (180.0402, 127.39705), (180.0402, 129.692987), (180.0402, 131.988925), (180.0402, 134.284862), (180.0402, 136.5808), (180.0402, 138.876738), (180.0402, 141.172675), (180.0402, 143.468613), (180.0402, 145.76455), (180.0402, 148.060487), (180.0402, 150.356425), (180.0402, 152.652362), (180.0402, 154.9483), (180.0402, 157.244237), (180.0402, 159.540175), (180.0402, 161.836112), (180.0402, 164.13205), (180.0402, 166.427987), (180.0402, 168.723925), (180.0402, 171.019862), (180.0402, 173.3158)], [(180.0402, 99.8458), (187.234935, 99.8458)], [(180.0402, 173.3158), (187.234935, 173.3158)]])\nVISIBLE_CIRCLES = [(129.3052, 136.5808, 36.735), (129.3052, 136.5808, 9.18375)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = [(119.0174, 85.8458, 119.0174, 78.6511), (125.1558, 85.8458, 125.1558, 78.6511), (106.9597, 85.8458, 106.9597, 78.6511), (113.0982, 85.8458, 113.0982, 78.6511), (141.0401, 85.8458, 141.0401, 78.6511), (116.8052, 85.8458, 116.8052, 78.6511), (138.489, 78.6511, 138.489, 85.8458), (138.4691, 85.8458, 138.4691, 78.6511), (150.5267, 85.8458, 150.5267, 78.6511), (144.3883, 85.8458, 144.3883, 78.6511), (132.3306, 85.8458, 132.3306, 78.6511), (120.1215, 85.8458, 120.1215, 78.6511), (180.0403, 155.893, 187.235, 155.893), (180.0403, 152.3853, 187.235, 152.3853), (180.0403, 135.0661, 187.235, 135.0661), (180.0403, 131.5585, 187.235, 131.5585), (180.0403, 125.5994, 187.235, 125.5994), (180.0403, 118.4565, 187.235, 118.4565), (180.0403, 155.9927, 187.235, 155.9927), (180.0403, 135.1658, 187.235, 135.1658), (180.0403, 131.6581, 187.235, 131.6581), (180.0403, 152.485, 187.235, 152.485), (180.0403, 127.3971, 187.235, 127.3971), (180.0403, 145.7646, 187.235, 145.7646)]\nDIMENSIONS = [('diameter', '%%c100', (129.3052, 136.5808), 36.735, 45), ('diameter', '%%c25', (129.3052, 136.5808), 9.1837, 135), ('horizontal', '32.9861', (116.8051, 125.5994), (141.0401, 125.5994), (128.9226, 136.5994)), ('vertical', '9.7222', (141.0401, 125.5994), (141.0401, 118.4564), (152.0401, 122.0279)), ('horizontal', '24.7667', (106.9597, 155.893), (125.1558, 155.893), (116.0578, 166.893)), ('vertical', '33.1217', (125.1558, 155.893), (125.1558, 131.5585), (136.1558, 143.7257)), ('aligned', '9.6229', (119.0174, 155.893), (125.1558, 152.3853), (127.5441, 163.6898)), ('aligned', '32.7555', (125.1558, 152.3853), (113.0982, 131.5585), (128.6467, 136.4605)), ('aligned', '9.6229', (113.0982, 131.5585), (106.9597, 135.0662), (104.5715, 123.7616)), ('aligned', '32.7555', (106.9597, 135.0662), (119.0174, 155.893), (103.4689, 150.991)), ('horizontal', '24.7667', (132.3307, 155.9926), (150.5268, 155.9926), (141.4287, 166.9926)), ('vertical', '33.1217', (150.5268, 155.9926), (150.5268, 131.6581), (161.5268, 143.8254)), ('aligned', '32.7555', (138.4691, 155.9926), (150.5268, 135.1658), (154.0176, 151.0906)), ('aligned', '9.6229', (150.5268, 135.1658), (144.3883, 131.6581), (152.915, 123.8613)), ('aligned', '32.7555', (144.3883, 131.6581), (132.3307, 152.4849), (128.8398, 136.5601)), ('aligned', '9.6229', (132.3307, 152.4849), (138.4691, 155.9926), (129.9423, 163.7895))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0080_00808827_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]} {"id":"0086_00869223","images":["images/0086_00869223.png"],"messages":[{"content":"\n\nYou are given an isometric (3D) view of a mechanical part together with a description of its geometric features. Write self-contained Python code using the ezdxf library that produces a 2D engineering drawing of this part: standard orthographic views with clear, fully-editable dimension entities. Output only the code.\n\nFeature description:\nThe base solid: The part is a rectangular plate 100 mm wide and 50.53 mm tall, featuring 2 circular holes, each of diameter 12.63 mm. It is extruded to a thickness of 14.71 mm. A union feature: The part is a polygonal plate with 4 straight edges. It is extruded to a thickness of 10.29 mm. The outline includes one or more oblique (angled) edges. A union feature: The part is a rectangular plate 2.51 mm wide and 19.85 mm tall. It is extruded to a thickness of 8.82 mm. A union feature: The part is a rectangular plate 2.51 mm wide and 19.85 mm tall. It is extruded to a thickness of 8.82 mm. A union feature: The part is a rectangular plate 2.51 mm wide and 19.85 mm tall. It is extruded to a thickness of 8.82 mm.","role":"user"},{"content":"```python\nimport sys\nimport ezdxf\nimport math\n\ndef _segments(chains):\n return [(a[0], a[1], b[0], b[1]) for chain in chains for a, b in zip(chain, chain[1:])]\nSCALE = 0.7718905468591187\nPAGE = [297.0, 210.0]\nVISIBLE_SEGMENTS = _segments([[(163.743227, 154.902529), (163.743227, 115.901744)], [(86.554173, 154.902529), (163.743227, 154.902529)], [(163.743227, 115.901744), (86.554173, 115.901744), (86.554173, 154.902529)], [(160.570829, 170.226827), (160.570829, 154.902529)], [(158.635128, 154.902529), (158.635128, 170.226827), (160.570829, 170.226827)], [(91.327706, 170.226827), (91.327706, 154.902529)], [(89.392006, 154.902529), (89.392006, 170.226827), (91.327706, 170.226827)], [(128.219534, 170.226827), (128.219534, 154.902529)], [(126.283833, 154.902529), (126.283833, 170.226827), (128.219534, 170.226827)], [(157.434277, 100.475881), (99.433035, 115.901744)], [(107.209773, 115.901744), (158.067562, 102.375736), (157.434277, 100.475881)], [(163.743227, 86.475881), (163.743227, 63.773218)], [(86.554173, 86.475881), (86.554173, 63.773218)], [(86.554173, 86.475881), (163.743227, 86.475881)], [(86.554173, 63.773218), (163.743227, 63.773218)], [(158.635128, 68.313751), (160.570829, 68.313751)], [(158.635128, 81.935349), (158.635128, 68.313751)], [(158.635128, 81.935349), (160.570829, 81.935349), (160.570829, 68.313751)], [(89.392006, 68.313751), (91.327706, 68.313751)], [(91.327706, 81.935349), (91.327706, 68.313751)], [(89.392006, 81.935349), (89.392006, 68.313751)], [(89.392006, 81.935349), (91.327706, 81.935349)], [(126.283833, 68.313751), (128.219534, 68.313751)], [(128.219534, 81.935349), (128.219534, 68.313751)], [(126.283833, 81.935349), (126.283833, 68.313751)], [(126.283833, 81.935349), (128.219534, 81.935349)], [(177.743227, 154.902529), (200.44589, 154.902529)], [(177.743227, 115.901744), (177.743227, 154.902529)], [(200.44589, 115.901744), (177.743227, 115.901744)], [(200.44589, 115.901744), (200.44589, 154.902529)], [(195.905358, 154.902529), (195.905358, 170.226827)], [(182.28376, 154.902529), (182.28376, 170.226827), (195.905358, 170.226827)], [(181.148627, 100.475881), (181.148627, 115.901744)], [(197.040491, 100.475881), (181.148627, 100.475881)], [(197.040491, 100.475881), (197.040491, 115.901744)]])\nVISIBLE_CIRCLES = [(106.054565, 143.5273, 4.875098), (144.242835, 143.5273, 4.875098)]\nVISIBLE_ARCS = []\nHIDDEN_SEGMENTS = _segments([[(107.2097, 83.0705), (107.2097, 67.1786)], [(99.433, 67.1786), (99.433, 83.0705)], [(110.9296, 86.4759), (110.9296, 63.7732)], [(149.1179, 86.4759), (149.1179, 63.7732)], [(157.4342, 67.1786), (157.4342, 83.0705)], [(158.0675, 67.1786), (157.4342, 67.1786)], [(158.0675, 67.1786), (158.0675, 83.0705)], [(107.2097, 83.0705), (157.4342, 83.0705), (158.0675, 83.0705)], [(107.2097, 83.0705), (99.433, 83.0705)], [(157.4342, 67.1786), (107.2097, 67.1786), (99.433, 67.1786)], [(157.4342, 67.1786), (158.0675, 67.1786)], [(101.1794, 86.4759), (101.1794, 63.7732)], [(139.3677, 86.4759), (139.3677, 63.7732)], [(197.0405, 102.3757), (181.1486, 102.3757)], [(177.7432, 138.6522), (200.4459, 138.6522)], [(177.7432, 148.4024), (200.4459, 148.4024)]])\nDIMENSIONS = [('horizontal', '100', (163.7432, 115.9017), (86.5541, 115.9017), (125.1487, 104.9017)), ('vertical', '50.5263', (163.7432, 154.9025), (163.7432, 115.9017), (174.7432, 135.4021)), ('diameter', '%%c12.6316', (106.0546, 143.5273), 4.8751, 45), ('horizontal', '25.2632', (86.5541, 143.5273), (106.0546, 143.5273), (96.3044, 154.5273)), ('vertical', '14.7368', (106.0546, 154.9025), (106.0546, 143.5273), (117.0546, 149.2149)), ('diameter', '%%c12.6316', (144.2428, 143.5273), 4.8751, 45), ('horizontal', '74.7368', (86.5541, 143.5273), (144.2428, 143.5273), (115.3985, 154.5273)), ('vertical', '14.7368', (144.2428, 154.9025), (144.2428, 143.5273), (155.2428, 149.2149)), ('horizontal', '77.9412', (97.9055, 118.2078), (158.0676, 118.2078), (127.9865, 129.2078)), ('vertical', '22.9721', (158.0676, 118.2078), (158.0676, 100.4759), (169.0676, 109.3419)), ('horizontal', '14.7059', (86.5541, 154.9025), (97.9055, 154.9025), (92.2298, 165.9025)), ('vertical', '47.5387', (97.9055, 154.9025), (97.9055, 118.2078), (108.9055, 136.5552)), ('aligned', '2.5944', (158.0676, 102.3757), (157.4342, 100.4759), (168.1863, 97.9471)), ('horizontal', '2.5077', (89.392, 170.2268), (91.3277, 170.2268), (90.3598, 181.2268)), ('vertical', '19.8529', (91.3277, 170.2268), (91.3277, 154.9025), (102.3277, 162.5646)), ('horizontal', '3.6765', (86.5541, 154.9025), (89.392, 154.9025), (87.9731, 165.9025)), ('vertical', '19.8529', (89.392, 154.9025), (89.392, 170.2268), (78.392, 162.5646)), ('horizontal', '2.5077', (126.2838, 170.2268), (128.2195, 170.2268), (127.2516, 181.2268)), ('vertical', '19.8529', (128.2195, 170.2268), (128.2195, 154.9025), (139.2195, 162.5646)), ('horizontal', '51.4706', (86.5541, 154.9025), (126.2838, 154.9025), (106.419, 165.9025)), ('vertical', '19.8529', (126.2838, 154.9025), (126.2838, 170.2268), (115.2838, 162.5646)), ('horizontal', '2.5077', (158.6351, 170.2268), (160.5708, 170.2268), (159.603, 181.2268)), ('vertical', '19.8529', (160.5708, 170.2268), (160.5708, 154.9025), (171.5708, 162.5646)), ('horizontal', '93.3824', (86.5541, 154.9025), (158.6351, 154.9025), (122.5946, 165.9025)), ('vertical', '19.8529', (158.6351, 154.9025), (158.6351, 170.2268), (147.6351, 162.5646)), ('horizontal', '29.4118', (200.4459, 154.9025), (177.7432, 154.9025), (189.0945, 143.9025)), ('horizontal', '17.6471', (195.9053, 170.2268), (182.2838, 170.2268), (189.0945, 159.2268)), ('horizontal', '17.6471', (195.9053, 170.2268), (182.2838, 170.2268), (189.0945, 159.2268)), ('horizontal', '17.6471', (195.9053, 170.2268), (182.2838, 170.2268), (189.0945, 159.2268))]\n\ndef draw(out_path):\n doc = ezdxf.new('R2010', setup=True)\n msp = doc.modelspace()\n if 'HIDDEN' not in doc.linetypes:\n doc.linetypes.add('HIDDEN', pattern=[0.6, 0.4, -0.2])\n _ds = doc.dimstyles.get('EZDXF')\n _ds.dxf.dimtxt = 3.5\n _ds.dxf.dimasz = 2.5\n _ds.dxf.dimexe = 1.25\n _ds.dxf.dimgap = 0.625\n if 'OUTLINE' not in doc.layers:\n doc.layers.add('OUTLINE', color=7)\n if 'HIDDEN' not in doc.layers:\n doc.layers.add('HIDDEN', color=1, linetype='HIDDEN')\n SOLID = {'layer': 'OUTLINE'}\n HIDDEN = {'layer': 'HIDDEN', 'linetype': 'HIDDEN'}\n for x1, y1, x2, y2 in VISIBLE_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=SOLID)\n for cx, cy, r in VISIBLE_CIRCLES:\n msp.add_circle((cx, cy), r, dxfattribs=SOLID)\n for cx, cy, r, a1, a2 in VISIBLE_ARCS:\n msp.add_arc((cx, cy), r, a1, a2, dxfattribs=SOLID)\n for x1, y1, x2, y2 in HIDDEN_SEGMENTS:\n msp.add_line((x1, y1), (x2, y2), dxfattribs=HIDDEN)\n for d in DIMENSIONS:\n if d[0] in ('horizontal', 'vertical'):\n _, text, p1, p2, base = d\n msp.add_linear_dim(base=base, p1=p1, p2=p2, angle=0 if d[0] == 'horizontal' else 90, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'aligned':\n _, text, p1, p2, base = d\n ex, ey = (p2[0] - p1[0], p2[1] - p1[1])\n L = math.hypot(ex, ey) or 1.0\n dist = ((base[0] - p1[0]) * -ey + (base[1] - p1[1]) * ex) / L\n msp.add_aligned_dim(p1=p1, p2=p2, distance=dist, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'diameter':\n _, text, center, radius, angle = d\n msp.add_diameter_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n elif d[0] == 'radius':\n _, text, center, radius, angle = d\n msp.add_radius_dim(center=center, radius=radius, angle=angle, text=text, dimstyle='EZDXF').render()\n doc.saveas(out_path)\nif __name__ == '__main__':\n out = sys.argv[1] if len(sys.argv) > 1 else '0086_00869223_gt.dxf'\n draw(out)\n print('wrote', out)\n```","role":"assistant"}]}